File tree Expand file tree Collapse file tree 17 files changed +1641
-143
lines changed Expand file tree Collapse file tree 17 files changed +1641
-143
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ root : true ,
3
+ env : { browser : true , es2020 : true } ,
4
+ extends : [
5
+ 'eslint:recommended' ,
6
+ 'plugin:@typescript-eslint/recommended' ,
7
+ 'plugin:react-hooks/recommended' ,
8
+ ] ,
9
+ ignorePatterns : [ 'dist' , '.eslintrc.cjs' ] ,
10
+ parser : '@typescript-eslint/parser' ,
11
+ plugins : [ 'react-refresh' ] ,
12
+ rules : {
13
+ 'react-refresh/only-export-components' : [
14
+ 'warn' ,
15
+ { allowConstantExport : true } ,
16
+ ] ,
17
+ } ,
18
+ }
Original file line number Diff line number Diff line change 4
4
npm-debug.log *
5
5
yarn-debug.log *
6
6
yarn-error.log *
7
+ pnpm-debug.log *
7
8
lerna-debug.log *
8
- .pnpm-debug.log *
9
9
10
- # Diagnostic reports (https://nodejs.org/api/report.html)
11
- report. [0-9 ]* . [0-9 ]* . [0-9 ]* . [0-9 ]* .json
12
-
13
- # Runtime data
14
- pids
15
- * .pid
16
- * .seed
17
- * .pid.lock
18
-
19
- # Directory for instrumented libs generated by jscoverage/JSCover
20
- lib-cov
21
-
22
- # Coverage directory used by tools like istanbul
23
- coverage
24
- * .lcov
25
-
26
- # nyc test coverage
27
- .nyc_output
28
-
29
- # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30
- .grunt
31
-
32
- # Bower dependency directory (https://bower.io/)
33
- bower_components
34
-
35
- # node-waf configuration
36
- .lock-wscript
37
-
38
- # Compiled binary addons (https://nodejs.org/api/addons.html)
39
- build /Release
40
-
41
- # Dependency directories
42
- node_modules /
43
- jspm_packages /
44
-
45
- # Snowpack dependency directory (https://snowpack.dev/)
46
- web_modules /
47
-
48
- # TypeScript cache
49
- * .tsbuildinfo
50
-
51
- # Optional npm cache directory
52
- .npm
53
-
54
- # Optional eslint cache
55
- .eslintcache
56
-
57
- # Optional stylelint cache
58
- .stylelintcache
59
-
60
- # Microbundle cache
61
- .rpt2_cache /
62
- .rts2_cache_cjs /
63
- .rts2_cache_es /
64
- .rts2_cache_umd /
65
-
66
- # Optional REPL history
67
- .node_repl_history
68
-
69
- # Output of 'npm pack'
70
- * .tgz
71
-
72
- # Yarn Integrity file
73
- .yarn-integrity
74
-
75
- # dotenv environment variable files
76
- .env
77
- .env.development.local
78
- .env.test.local
79
- .env.production.local
80
- .env.local
81
-
82
- # parcel-bundler cache (https://parceljs.org/)
83
- .cache
84
- .parcel-cache
85
-
86
- # Next.js build output
87
- .next
88
- out
89
-
90
- # Nuxt.js build / generate output
91
- .nuxt
10
+ node_modules
92
11
dist
93
-
94
- # Gatsby files
95
- .cache /
96
- # Comment in the public line in if your project uses Gatsby and not Next.js
97
- # https://nextjs.org/blog/next-9-1#public-directory-support
98
- # public
99
-
100
- # vuepress build output
101
- .vuepress /dist
102
-
103
- # vuepress v2.x temp and cache directory
104
- .temp
105
- .cache
106
-
107
- # Docusaurus cache and generated files
108
- .docusaurus
109
-
110
- # Serverless directories
111
- .serverless /
112
-
113
- # FuseBox cache
114
- .fusebox /
115
-
116
- # DynamoDB Local files
117
- .dynamodb /
118
-
119
- # TernJS port file
120
- .tern-port
121
-
122
- # Stores VSCode versions used for testing VSCode extensions
123
- .vscode-test
124
-
125
- # yarn v2
126
- .yarn /cache
127
- .yarn /unplugged
128
- .yarn /build-state.yml
129
- .yarn /install-state.gz
130
- .pnp. *
12
+ dist-ssr
13
+ * .local
14
+
15
+ # Editor directories and files
16
+ .vscode /*
17
+ ! .vscode /extensions.json
18
+ .idea
19
+ .DS_Store
20
+ * .suo
21
+ * .ntvs *
22
+ * .njsproj
23
+ * .sln
24
+ * .sw ?
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- # eh-fe
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
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
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level ` parserOptions ` property like this:
15
+
16
+ ``` js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: ' latest' ,
21
+ sourceType: ' module' ,
22
+ project: [' ./tsconfig.json' , ' ./tsconfig.node.json' ],
23
+ tsconfigRootDir: __dirname ,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace ` plugin:@typescript-eslint/recommended ` to ` plugin:@typescript-eslint/recommended-type-checked ` or ` plugin:@typescript-eslint/strict-type-checked `
29
+ - Optionally add ` plugin:@typescript-eslint/stylistic-type-checked `
30
+ - Install [ eslint-plugin-react] ( https://github.com/jsx-eslint/eslint-plugin-react ) and add ` plugin:react/recommended ` & ` plugin:react/jsx-runtime ` to the ` extends ` list
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < 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 >
13
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " eh-fe" ,
3
+ "private" : true ,
4
+ "version" : " 0.0.0" ,
5
+ "type" : " module" ,
6
+ "scripts" : {
7
+ "dev" : " vite" ,
8
+ "build" : " tsc && vite build" ,
9
+ "lint" : " eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0" ,
10
+ "preview" : " vite preview"
11
+ },
12
+ "dependencies" : {
13
+ "react" : " ^18.2.0" ,
14
+ "react-dom" : " ^18.2.0"
15
+ },
16
+ "devDependencies" : {
17
+ "@types/react" : " ^18.2.43" ,
18
+ "@types/react-dom" : " ^18.2.17" ,
19
+ "@typescript-eslint/eslint-plugin" : " ^6.14.0" ,
20
+ "@typescript-eslint/parser" : " ^6.14.0" ,
21
+ "@vitejs/plugin-react-swc" : " ^3.5.0" ,
22
+ "eslint" : " ^8.55.0" ,
23
+ "eslint-plugin-react-hooks" : " ^4.6.0" ,
24
+ "eslint-plugin-react-refresh" : " ^0.4.5" ,
25
+ "typescript" : " ^5.2.2" ,
26
+ "vite" : " ^5.0.8"
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ # root {
2
+ max-width : 1280px ;
3
+ margin : 0 auto;
4
+ padding : 2rem ;
5
+ text-align : center;
6
+ }
7
+
8
+ .logo {
9
+ height : 6em ;
10
+ padding : 1.5em ;
11
+ will-change : filter;
12
+ transition : filter 300ms ;
13
+ }
14
+ .logo : hover {
15
+ filter : drop-shadow (0 0 2em # 646cffaa );
16
+ }
17
+ .logo .react : hover {
18
+ filter : drop-shadow (0 0 2em # 61dafbaa );
19
+ }
20
+
21
+ @keyframes logo-spin {
22
+ from {
23
+ transform : rotate (0deg );
24
+ }
25
+ to {
26
+ transform : rotate (360deg );
27
+ }
28
+ }
29
+
30
+ @media (prefers-reduced-motion : no-preference) {
31
+ a : nth-of-type (2 ) .logo {
32
+ animation : logo-spin infinite 20s linear;
33
+ }
34
+ }
35
+
36
+ .card {
37
+ padding : 2em ;
38
+ }
39
+
40
+ .read-the-docs {
41
+ color : # 888 ;
42
+ }
Original file line number Diff line number Diff line change
1
+ import { useState } from 'react'
2
+ import reactLogo from './assets/react.svg'
3
+ import viteLogo from '/vite.svg'
4
+ import './App.css'
5
+
6
+ function App ( ) {
7
+ const [ count , setCount ] = useState ( 0 )
8
+
9
+ return (
10
+ < >
11
+ < div >
12
+ < a href = "https://vitejs.dev" target = "_blank" >
13
+ < img src = { viteLogo } className = "logo" alt = "Vite logo" />
14
+ </ a >
15
+ < a href = "https://react.dev" target = "_blank" >
16
+ < img src = { reactLogo } className = "logo react" alt = "React logo" />
17
+ </ a >
18
+ </ div >
19
+ < h1 > Vite + React</ h1 >
20
+ < div className = "card" >
21
+ < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
22
+ count is { count }
23
+ </ button >
24
+ < p >
25
+ Edit < code > src/App.tsx</ code > and save to test HMR
26
+ </ p >
27
+ </ div >
28
+ < p className = "read-the-docs" >
29
+ Click on the Vite and React logos to learn more
30
+ </ p >
31
+ </ >
32
+ )
33
+ }
34
+
35
+ export default App
You can’t perform that action at this time.
0 commit comments