Skip to content

Commit 7f2d231

Browse files
committed
style: code format
1 parent decea0c commit 7f2d231

14 files changed

Lines changed: 246 additions & 263 deletions

File tree

.lintstagedrc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
2-
'**/*.{ts,tsx,js,jsx}': ['eslint', 'tsc --noEmit --allowJs'],
2+
'**/*.{ts,tsx,js,jsx}': ['eslint'],
33
'**/*.{js,ts,jsx,tsx,md,css}': ['prettier --check'],
44
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
},
4747
"simple-git-hooks": {
4848
"commit-msg": "npx commitlint -e",
49-
"pre-commit": "npx lint-staged"
49+
"pre-commit": "npx lint-staged && npx tsc --noEmit"
5050
}
5151
}

workspaces/example/index.html

Lines changed: 76 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,81 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Entrance Navigation</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Entrance Navigation</title>
8-
</head>
9+
<body>
10+
<fieldset>
11+
<legend>
12+
<a href="/">Entrances</a>
13+
</legend>
14+
<ul>
15+
<li>
16+
<a href="/home">/home</a>
17+
</li>
18+
<li>
19+
<a href="/home.html">/home.html</a>
20+
</li>
21+
<li>
22+
<a href="/home2">/home2</a>
23+
</li>
24+
<li>
25+
<a href="/home2.html">/home2.html</a>
26+
</li>
27+
<li>
28+
<a href="/apple">/apple</a>
29+
</li>
30+
<li>
31+
<a href="/apple.html">/apple.html</a>
32+
</li>
33+
</ul>
34+
</fieldset>
935

10-
<body>
11-
<fieldset>
12-
<legend>
13-
<a href="/">Entrances</a>
14-
</legend>
15-
<ul>
16-
<li>
17-
<a href="/home">/home</a>
18-
</li>
19-
<li>
20-
<a href="/home.html">/home.html</a>
21-
</li>
22-
<li>
23-
<a href="/home2">/home2</a>
24-
</li>
25-
<li>
26-
<a href="/home2.html">/home2.html</a>
27-
</li>
28-
<li>
29-
<a href="/apple">/apple</a>
30-
</li>
31-
<li>
32-
<a href="/apple.html">/apple.html</a>
33-
</li>
34-
</ul>
35-
</fieldset>
36-
37-
<fieldset>
38-
<legend>Others</legend>
39-
<ul>
40-
<li>
41-
<a href="/">/ -> /index.html</a>
42-
</li>
43-
<li>
44-
<a href="/infos">/infos -> /index.html</a>
45-
</li>
46-
<li>
47-
<a href="/infos/">/infos/ -> Infos Index</a>
48-
</li>
49-
<li>
50-
<a href="/infos/index.html">/infos/index.html -> Infos Index</a>
51-
</li>
52-
<li>
53-
<a href="/infos/other">/infos/other -> /index.html</a>
54-
</li>
55-
<li>
56-
<a href="/infos/other/">/infos/other/ -> 404</a>
57-
</li>
58-
<li>
59-
<a href="/infos/other/other.html">/infos/other/other.html -> Infos Other</a>
60-
</li>
61-
</ul>
62-
</fieldset>
63-
64-
<fieldset>
65-
<legend>Assets</legend>
66-
<ul>
67-
<li>
68-
<a href="/src/assets/test1.svg" target="_blank">/src/assets/test1.svg</a>
69-
</li>
70-
<li>
71-
<a href="/src/assets/test2.png" target="_blank">/src/assets/test2.png</a>
72-
</li>
73-
</ul>
74-
</fieldset>
75-
76-
</body>
36+
<fieldset>
37+
<legend>Others</legend>
38+
<ul>
39+
<li>
40+
<a href="/">/ -> /index.html</a>
41+
</li>
42+
<li>
43+
<a href="/infos">/infos -> /index.html</a>
44+
</li>
45+
<li>
46+
<a href="/infos/">/infos/ -> Infos Index</a>
47+
</li>
48+
<li>
49+
<a href="/infos/index.html">/infos/index.html -> Infos Index</a>
50+
</li>
51+
<li>
52+
<a href="/infos/other">/infos/other -> /index.html</a>
53+
</li>
54+
<li>
55+
<a href="/infos/other/">/infos/other/ -> 404</a>
56+
</li>
57+
<li>
58+
<a href="/infos/other/other.html"
59+
>/infos/other/other.html -> Infos Other</a
60+
>
61+
</li>
62+
</ul>
63+
</fieldset>
7764

65+
<fieldset>
66+
<legend>Assets</legend>
67+
<ul>
68+
<li>
69+
<a href="/src/assets/test1.svg" target="_blank"
70+
>/src/assets/test1.svg</a
71+
>
72+
</li>
73+
<li>
74+
<a href="/src/assets/test2.png" target="_blank"
75+
>/src/assets/test2.png</a
76+
>
77+
</li>
78+
</ul>
79+
</fieldset>
80+
</body>
7881
</html>
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Infos Index</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Infos Index</title>
8-
</head>
9-
10-
<body>
11-
<h1>Infos Index</h1>
12-
<a href="/">Back to root</a>
13-
</body>
14-
15-
</html>
9+
<body>
10+
<h1>Infos Index</h1>
11+
<a href="/">Back to root</a>
12+
</body>
13+
</html>
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Infos Other</title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Infos Other</title>
8-
</head>
9-
10-
<body>
11-
<h1>Infos Other</h1>
12-
<a href="/">Back to root</a>
13-
</body>
14-
15-
</html>
9+
<body>
10+
<h1>Infos Other</h1>
11+
<a href="/">Back to root</a>
12+
</body>
13+
</html>

workspaces/example/jsconfig.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,8 @@
66
"baseUrl": "./",
77
"moduleResolution": "node",
88
"paths": {
9-
"@/*": [
10-
"src/*"
11-
],
9+
"@/*": ["src/*"]
1210
},
13-
"lib": [
14-
"esnext",
15-
"dom",
16-
"dom.iterable",
17-
"scripthost"
18-
]
11+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
1912
}
20-
}
13+
}
Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title><%= title %></title>
7+
</head>
38

4-
<head>
5-
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>
8-
<%= title %>
9-
</title>
10-
</head>
9+
<body>
10+
<fieldset>
11+
<legend>App Container</legend>
12+
<div id="root"></div>
13+
</fieldset>
1114

12-
<body>
13-
<fieldset>
14-
<legend>App Container</legend>
15-
<div id="root"></div>
16-
</fieldset>
15+
<fieldset>
16+
<legend>ENV Injection</legend>
17+
<p>
18+
ENV variables that start with 'VITE_' will be auto injected into the
19+
provided template.
20+
<a
21+
href="https://vitejs.dev/config/shared-options.html#envprefix"
22+
target="_blank"
23+
>More</a
24+
>
25+
</p>
26+
27+
<ul>
28+
<li>VITE_TEST: <%= VITE_TEST %></li>
29+
<li>VITE_APP_KEY: <%= VITE_APP_KEY %></li>
30+
</ul>
31+
</fieldset>
1732

18-
<fieldset>
19-
<legend>ENV Injection</legend>
2033
<p>
21-
ENV variables that start with 'VITE_' will be auto injected into the provided template.
22-
<a href="https://vitejs.dev/config/shared-options.html#envprefix" target="_blank">More</a>
34+
<a href="/">Back to root</a>
2335
</p>
24-
25-
<ul>
26-
<li>
27-
VITE_TEST: <%= VITE_TEST %>
28-
</li>
29-
<li>
30-
VITE_APP_KEY: <%= VITE_APP_KEY %>
31-
</li>
32-
</ul>
33-
</fieldset>
34-
35-
<p>
36-
<a href="/">Back to root</a>
37-
</p>
38-
</body>
39-
40-
</html>
36+
</body>
37+
</html>

workspaces/example/vite.config.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default defineConfig({
7171
scanOptions: {
7272
scanDirs: 'src/pages',
7373
entryFile: 'index.js',
74-
filename: name => `fruits/${name}.html`,
74+
filename: (name) => `fruits/${name}.html`,
7575
template: '../../template.html',
7676
},
7777
/**
@@ -109,10 +109,7 @@ export default defineConfig({
109109
*/
110110
watchOptions: {
111111
events: ['add', 'unlink', 'change'],
112-
include: [
113-
'**/pages/**',
114-
'**/infos/**',
115-
],
112+
include: ['**/pages/**', '**/infos/**'],
116113
handler: (ctx) => {
117114
console.log(ctx.type, ctx.file);
118115
// ctx.reloadPages();

0 commit comments

Comments
 (0)