Skip to content

Commit c6b4bb0

Browse files
committed
Ported to Vite
1 parent 1f20ea3 commit c6b4bb0

20 files changed

+2518
-18963
lines changed

.gitignore

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
15-
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
20-
1+
# Logs
2+
logs
3+
*.log
214
npm-debug.log*
225
yarn-debug.log*
236
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
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?
25+
.react-app
26+
.vite-app

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,51 @@ A React UI to experiment with real-time phasing of MIDI rhythms and first use of
3131

3232
# Blah
3333

34-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
34+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
35+
36+
Currently, two official plugins are available:
37+
38+
- [@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
39+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
40+
41+
## Expanding the ESLint configuration
42+
43+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
44+
45+
- Configure the top-level `parserOptions` property like this:
46+
47+
```js
48+
export default tseslint.config({
49+
languageOptions: {
50+
// other options...
51+
parserOptions: {
52+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
53+
tsconfigRootDir: import.meta.dirname,
54+
},
55+
},
56+
})
57+
```
58+
59+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
60+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
61+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
62+
63+
```js
64+
// eslint.config.js
65+
import react from 'eslint-plugin-react'
66+
67+
export default tseslint.config({
68+
// Set the react version
69+
settings: { react: { version: '18.3' } },
70+
plugins: {
71+
// Add the react plugin
72+
react,
73+
},
74+
rules: {
75+
// other rules...
76+
// Enable its recommended rules
77+
...react.configs.recommended.rules,
78+
...react.configs['jsx-runtime'].rules,
79+
},
80+
})
81+
```

README/screenshot.png

-36.9 KB
Binary file not shown.

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>

0 commit comments

Comments
 (0)