Skip to content

Commit 7ff57d9

Browse files
committed
yolo
0 parents  commit 7ff57d9

Some content is hidden

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

44 files changed

+873
-0
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_PORT=5555

.eslintrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
ecmaVersion: 2021,
5+
sourceType: 'module',
6+
ecmaFeatures: { jsx: true },
7+
},
8+
settings: {
9+
react: { version: 'detect' },
10+
'import/resolver': {
11+
typescript: {},
12+
},
13+
},
14+
env: { browser: true, es2021: true },
15+
plugins: ['react', 'react-hooks', '@typescript-eslint'],
16+
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:react-hooks/recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
17+
rules: {},
18+
};

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
pnpm-lock.yaml
15+
package-lock.json
16+
17+
# Editor directories and files
18+
.vscode/*
19+
!.vscode/extensions.json
20+
.idea
21+
.DS_Store
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 180
7+
}

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 tseslint.config({
18+
languageOptions: {
19+
// other options...
20+
parserOptions: {
21+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
22+
tsconfigRootDir: import.meta.dirname,
23+
},
24+
},
25+
})
26+
```
27+
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31+
32+
```js
33+
// eslint.config.js
34+
import react from 'eslint-plugin-react'
35+
36+
export default tseslint.config({
37+
// Set the react version
38+
settings: { react: { version: '18.3' } },
39+
plugins: {
40+
// Add the react plugin
41+
react,
42+
},
43+
rules: {
44+
// other rules...
45+
// Enable its recommended rules
46+
...react.configs.recommended.rules,
47+
...react.configs['jsx-runtime'].rules,
48+
},
49+
})
50+
```

eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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": ["warn", { allowConstantExport: true }],
23+
},
24+
}
25+
);

index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
6+
7+
<link rel="icon" href="./favicon.ico" />
8+
9+
<title>react-typescript-template</title>
10+
</head>
11+
12+
<body>
13+
<div id="root"></div>
14+
15+
<script type="module" src="./src/main.tsx"></script>
16+
</body>
17+
</html>

package.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "react-typescript-template",
3+
"description": "react-typescript-template",
4+
"version": "1.0",
5+
"type": "module",
6+
"author": "HolyMolly",
7+
"license": "ISC",
8+
"scripts": {
9+
"start": "vite",
10+
"build": "rm -rf dist && vite build",
11+
"preview": "vite preview",
12+
"lint": "eslint .",
13+
"clean": "rm -rf node_modules dist pnpm-lock.yaml package-lock.json",
14+
"clean:vite-cache": "rm -rf node_modules/.vite"
15+
},
16+
"dependencies": {
17+
"react": "18.3.1",
18+
"react-dom": "18.3.1"
19+
},
20+
"devDependencies": {
21+
"@eslint/js": "9.18.0",
22+
"@reduxjs/toolkit": "2.5.0",
23+
"@tailwindcss/postcss": "4.0.0",
24+
"@types/node": "^22.10.10",
25+
"@types/react": "19.0.8",
26+
"@types/react-dom": "19.0.3",
27+
"@types/react-redux": "7.1.34",
28+
"@typescript-eslint/eslint-plugin": "8.21.0",
29+
"@typescript-eslint/parser": "8.21.0",
30+
"@vitejs/plugin-react": "4.3.4",
31+
"axios": "1.7.9",
32+
"classnames": "2.5.1",
33+
"dotenv": "^16.4.7",
34+
"eslint": "9.18.0",
35+
"eslint-config-prettier": "10.0.1",
36+
"eslint-plugin-react": "7.37.4",
37+
"eslint-plugin-react-hooks": "5.1.0",
38+
"eslint-plugin-react-refresh": "0.4.18",
39+
"globals": "15.14.0",
40+
"postcss": "8.5.1",
41+
"prettier": "3.4.2",
42+
"react-redux": "9.2.0",
43+
"react-router-dom": "7.1.3",
44+
"sass": "1.83.4",
45+
"sass-embedded": "1.83.4",
46+
"tailwindcss": "4.0.0",
47+
"typescript": "5.7.3",
48+
"vite": "6.0.11",
49+
"vite-tsconfig-paths": "5.1.4"
50+
}
51+
}

postcss.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
},
5+
};

public/favicon.ico

16.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)