Skip to content

Commit 28cb11e

Browse files
committed
style: reformat everything
1 parent 23b485c commit 28cb11e

15 files changed

+4080
-4034
lines changed

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ This template provides a minimal setup to get React working in Vite with HMR and
44

55
Currently, two official plugins are available:
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md)
8+
uses [Babel](https://babeljs.io/) for Fast Refresh
9+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast
10+
Refresh
911

1012
## Expanding the ESLint configuration
1113

@@ -31,24 +33,27 @@ export default tseslint.config({
3133
})
3234
```
3335

34-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
36+
You can also
37+
install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x)
38+
and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom)
39+
for React-specific lint rules:
3540

3641
```js
3742
// eslint.config.js
3843
import reactX from 'eslint-plugin-react-x'
3944
import reactDom from 'eslint-plugin-react-dom'
4045

4146
export default tseslint.config({
42-
plugins: {
43-
// Add the react-x and react-dom plugins
44-
'react-x': reactX,
45-
'react-dom': reactDom,
46-
},
47-
rules: {
48-
// other rules...
49-
// Enable its recommended typescript rules
50-
...reactX.configs['recommended-typescript'].rules,
51-
...reactDom.configs.recommended.rules,
52-
},
47+
plugins: {
48+
// Add the react-x and react-dom plugins
49+
'react-x': reactX,
50+
'react-dom': reactDom,
51+
},
52+
rules: {
53+
// other rules...
54+
// Enable its recommended typescript rules
55+
...reactX.configs['recommended-typescript'].rules,
56+
...reactDom.configs.recommended.rules,
57+
},
5358
})
5459
```

eslint.config.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import reactX from 'eslint-plugin-react-x'
66
import reactDom from 'eslint-plugin-react-dom'
77

88
export default tseslint.config({ignores: ['dist']}, {
9-
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked,],
10-
files: ['**/*.{ts,tsx}'],
11-
languageOptions: {
12-
ecmaVersion: 2020, globals: globals.browser, parserOptions: {
13-
project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname,
14-
},
15-
},
16-
plugins: {
17-
'react-hooks': reactHooks, 'react-refresh': reactRefresh, 'react-x': reactX, 'react-dom': reactDom,
18-
},
19-
rules: {
20-
...reactHooks.configs.recommended.rules,
21-
'react-refresh/only-export-components': ['warn', {allowConstantExport: true},],
22-
...reactX.configs['recommended-typescript'].rules,
23-
...reactDom.configs.recommended.rules,
24-
},
25-
},)
9+
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
10+
files: ['**/*.{ts,tsx}'],
11+
languageOptions: {
12+
ecmaVersion: 2020, globals: globals.browser, parserOptions: {
13+
project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname,
14+
},
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks, 'react-refresh': reactRefresh, 'react-x': reactX, 'react-dom': reactDom,
18+
},
19+
rules: {
20+
...reactHooks.configs.recommended.rules,
21+
'react-refresh/only-export-components': ['warn', {allowConstantExport: true}],
22+
...reactX.configs['recommended-typescript'].rules,
23+
...reactDom.configs.recommended.rules,
24+
},
25+
})

index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
8-
</head>
9-
<body>
10-
<div id="root"></div>
11-
<script type="module" src="/src/main.tsx"></script>
12-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link href="/vite.svg" rel="icon" type="image/svg+xml" />
6+
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script src="/src/main.tsx" type="module"></script>
12+
</body>
1313
</html>

0 commit comments

Comments
 (0)