Skip to content

Commit dedb906

Browse files
authored
Chore/enhance prettier config (#1059)
* chore: enhance prettier config * chore: fix prettier issues
1 parent 5f5a598 commit dedb906

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+871
-841
lines changed

.github/DISCUSSION_TEMPLATE/bug-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
labels: ["bug"]
1+
labels: ['bug']
22
body:
33
- type: markdown
44
attributes:

.github/ISSUE_TEMPLATE/bug_report.md

-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ about: This is to create a new issue that already has an assignee. Please open a
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
9-

.github/pull_request_template.md

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Fixes #
44

55
## Summary
66

7-
8-
97
## Check List
108

119
- [ ] `pnpm run fix` for formatting and linting code and docs

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
pnpm-lock.yaml

examples/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Simple examples
44

5-
* [Starter](https://github.com/pmndrs/valtio/tree/main/examples/starter)
6-
* [Counter](https://github.com/pmndrs/valtio/tree/main/examples/counter)
7-
* [Todo](https://github.com/pmndrs/valtio/tree/main/examples/todo)
8-
* [Todo with proxyMap](https://github.com/pmndrs/valtio/tree/main/examples/todo-with-proxyMap)
5+
- [Starter](https://github.com/pmndrs/valtio/tree/main/examples/starter)
6+
- [Counter](https://github.com/pmndrs/valtio/tree/main/examples/counter)
7+
- [Todo](https://github.com/pmndrs/valtio/tree/main/examples/todo)
8+
- [Todo with proxyMap](https://github.com/pmndrs/valtio/tree/main/examples/todo-with-proxyMap)

examples/counter/src/prism.css

+62-53
Original file line numberDiff line numberDiff line change
@@ -5,81 +5,82 @@
55

66
code[class*='language-'],
77
pre[class*='language-'] {
8-
color: #393a34;
9-
font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;
10-
direction: ltr;
11-
text-align: left;
12-
white-space: pre;
13-
word-spacing: normal;
14-
word-break: normal;
15-
font-size: 0.9em;
16-
line-height: 1.2em;
17-
18-
-moz-tab-size: 4;
19-
-o-tab-size: 4;
20-
tab-size: 4;
21-
22-
-webkit-hyphens: none;
23-
-moz-hyphens: none;
24-
-ms-hyphens: none;
25-
hyphens: none;
8+
color: #393a34;
9+
font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier,
10+
monospace;
11+
direction: ltr;
12+
text-align: left;
13+
white-space: pre;
14+
word-spacing: normal;
15+
word-break: normal;
16+
font-size: 0.9em;
17+
line-height: 1.2em;
18+
19+
-moz-tab-size: 4;
20+
-o-tab-size: 4;
21+
tab-size: 4;
22+
23+
-webkit-hyphens: none;
24+
-moz-hyphens: none;
25+
-ms-hyphens: none;
26+
hyphens: none;
2627
}
2728

2829
pre > code[class*='language-'] {
29-
font-size: 1em;
30+
font-size: 1em;
3031
}
3132

3233
pre[class*='language-']::-moz-selection,
3334
pre[class*='language-'] ::-moz-selection,
3435
code[class*='language-']::-moz-selection,
3536
code[class*='language-'] ::-moz-selection {
36-
background: #c1def1;
37+
background: #c1def1;
3738
}
3839

3940
pre[class*='language-']::selection,
4041
pre[class*='language-'] ::selection,
4142
code[class*='language-']::selection,
4243
code[class*='language-'] ::selection {
43-
background: #c1def1;
44+
background: #c1def1;
4445
}
4546

4647
/* Code blocks */
4748
pre[class*='language-'] {
48-
padding: 1em;
49-
margin: 0.5em 0;
50-
overflow: auto;
51-
border: 1px solid #dddddd;
52-
background-color: white;
49+
padding: 1em;
50+
margin: 0.5em 0;
51+
overflow: auto;
52+
border: 1px solid #dddddd;
53+
background-color: white;
5354
}
5455

5556
/* Inline code */
5657
:not(pre) > code[class*='language-'] {
57-
padding: 0.2em;
58-
padding-top: 1px;
59-
padding-bottom: 1px;
60-
background: #f8f8f8;
61-
border: 1px solid #dddddd;
58+
padding: 0.2em;
59+
padding-top: 1px;
60+
padding-bottom: 1px;
61+
background: #f8f8f8;
62+
border: 1px solid #dddddd;
6263
}
6364

6465
.token.comment,
6566
.token.prolog,
6667
.token.doctype,
6768
.token.cdata {
68-
color: #b2b8c0;
69-
font-style: italic;
69+
color: #b2b8c0;
70+
font-style: italic;
7071
}
7172

7273
.token.namespace {
73-
opacity: 0.7;
74+
opacity: 0.7;
7475
}
7576

7677
.token.string {
77-
color: #67c2c7;
78+
color: #67c2c7;
7879
}
7980

8081
.token.punctuation,
8182
.token.operator {
82-
color: #393a34 !important; /* no highlight */
83+
color: #393a34 !important; /* no highlight */
8384
}
8485

8586
.token.url,
@@ -89,7 +90,7 @@ pre[class*='language-'] {
8990
.token.variable,
9091
.token.constant,
9192
.token.inserted {
92-
color: #36acaa;
93+
color: #36acaa;
9394
}
9495

9596
.token.atrule,
@@ -99,70 +100,78 @@ pre[class*='language-'] {
99100
.language-json .token.boolean,
100101
.language-json .token.number,
101102
code[class*='language-css'] {
102-
color: #9494ab;
103+
color: #9494ab;
103104
}
104105

105106
.token.function {
106-
color: #ff7bab;
107+
color: #ff7bab;
107108
}
108109

109110
.token.deleted,
110111
.language-autohotkey .token.tag {
111-
color: #9a050f;
112+
color: #9a050f;
112113
}
113114

114115
.token.selector,
115116
.language-autohotkey .token.keyword {
116-
color: #00009f;
117+
color: #00009f;
117118
}
118119

119120
.token.important,
120121
.token.bold {
121-
font-weight: bold;
122+
font-weight: bold;
122123
}
123124

124125
.token.italic {
125-
font-style: italic;
126+
font-style: italic;
126127
}
127128

128129
.token.class-name,
129130
.language-json .token.property {
130-
color: #67c2c7;
131+
color: #67c2c7;
131132
}
132133

133134
.token.tag,
134135
.token.selector {
135-
color: #67c2c7;
136+
color: #67c2c7;
136137
}
137138

138139
.token.attr-name,
139140
.token.property,
140141
.token.regex,
141142
.token.entity {
142-
color: #91adbd;
143+
color: #91adbd;
143144
}
144145

145146
.token.directive.tag .tag {
146-
background: #ffff00;
147-
color: #393a34;
147+
background: #ffff00;
148+
color: #393a34;
148149
}
149150

150151
/* overrides color-values for the Line Numbers plugin
151152
* http://prismjs.com/plugins/line-numbers/
152153
*/
153154
.line-numbers .line-numbers-rows {
154-
border-right-color: #a5a5a5;
155+
border-right-color: #a5a5a5;
155156
}
156157

157158
.line-numbers-rows > span:before {
158-
color: #2b91af;
159+
color: #2b91af;
159160
}
160161

161162
/* overrides color-values for the Line Highlight plugin
162163
* http://prismjs.com/plugins/line-highlight/
163164
*/
164165
.line-highlight {
165-
background: rgba(193, 222, 241, 0.2);
166-
background: -webkit-linear-gradient(left, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0));
167-
background: linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0));
166+
background: rgba(193, 222, 241, 0.2);
167+
background: -webkit-linear-gradient(
168+
left,
169+
rgba(193, 222, 241, 0.2) 70%,
170+
rgba(221, 222, 241, 0)
171+
);
172+
background: linear-gradient(
173+
to right,
174+
rgba(193, 222, 241, 0.2) 70%,
175+
rgba(221, 222, 241, 0)
176+
);
168177
}

examples/photo-booth-vanillajs/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Photo Booth</title>
77
<link
88
rel="stylesheet"
9-
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css" />
9+
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
10+
/>
1011
</head>
1112

1213
<body>

examples/photo-booth-vanillajs/src/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const snapPicButton = document.getElementById('take-pic-btn')
2020
const acceptPicButton = document.getElementById('accept-pic-btn')
2121
const rejectPicButton = document.getElementById('reject-pic-btn')
2222
const candidateImgControlsContainer = document.getElementById(
23-
'candidate-img-controls'
23+
'candidate-img-controls',
2424
)
2525

2626
const store = proxy({
@@ -96,7 +96,7 @@ function renderImages(images, selectedId) {
9696
</a>
9797
`
9898
})}
99-
`
99+
`,
100100
)
101101
}
102102

@@ -121,7 +121,7 @@ function renderCanvasControls(hasCandidateImage) {
121121
<button id="accept-pic-btn" class=${className} onclick=${keepCandidateImage}>
122122
Keep picture</button>
123123
<button id="reject-pic-btn" class=${className} onclick=${removeCandidateImage}>Reject picture</button>
124-
`
124+
`,
125125
)
126126
}
127127

examples/starter/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

examples/starter/src/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ body,
1010
justify-content: center;
1111

1212
color: #fff;
13-
background-color: rgb(23 23 23)
13+
background-color: rgb(23 23 23);
1414
}

examples/starter/src/index.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { StrictMode } from 'react';
2-
import { createRoot } from 'react-dom/client';
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
33
import { proxy, useSnapshot } from 'valtio'
44

5-
import banner from './assets/banner.svg';
5+
import banner from './assets/banner.svg'
66

7-
import './index.css';
7+
import './index.css'
88

9-
const state = proxy({ count: 0 });
9+
const state = proxy({ count: 0 })
1010

1111
const Counter = () => {
1212
const snap = useSnapshot(state)
@@ -21,8 +21,8 @@ const Counter = () => {
2121
+1
2222
</button>
2323
</>
24-
);
25-
};
24+
)
25+
}
2626

2727
function App() {
2828
return (
@@ -42,11 +42,11 @@ function App() {
4242

4343
<Counter />
4444
</div>
45-
);
45+
)
4646
}
4747

4848
createRoot(document.getElementById('root')!).render(
4949
<StrictMode>
5050
<App />
5151
</StrictMode>,
52-
);
52+
)

examples/starter/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@
1919
"include": ["vite.config.ts", "./src/**/*"],
2020
"exclude": ["node_modules"]
2121
}
22-

examples/starter/vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import react from '@vitejs/plugin-react-swc';
2-
import { defineConfig } from 'vite';
1+
import react from '@vitejs/plugin-react-swc'
2+
import { defineConfig } from 'vite'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7-
});
7+
})

examples/subscribe/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />
@@ -8,7 +8,8 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<link
1010
rel="stylesheet"
11-
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css" />
11+
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
12+
/>
1213
</head>
1314
<body>
1415
<script type="module" async defer>

0 commit comments

Comments
 (0)