Skip to content

Commit 9615013

Browse files
committed
first commit
0 parents  commit 9615013

22 files changed

+5611
-0
lines changed

.gitignore

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

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
build

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"tabWidth": 2,
5+
"printWidth": 80,
6+
"trailingComma": "es5",
7+
"arrowParens": "always",
8+
"endOfLine": "auto"
9+
}

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
```js
15+
export default tseslint.config({
16+
extends: [
17+
// Remove ...tseslint.configs.recommended and replace with this
18+
...tseslint.configs.recommendedTypeChecked,
19+
// Alternatively, use this for stricter rules
20+
...tseslint.configs.strictTypeChecked,
21+
// Optionally, add this for stylistic rules
22+
...tseslint.configs.stylisticTypeChecked,
23+
],
24+
languageOptions: {
25+
// other options...
26+
parserOptions: {
27+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
})
32+
```
33+
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:
35+
36+
```js
37+
// eslint.config.js
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
40+
41+
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+
},
53+
})
54+
```

eslint.config.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
import prettier from "eslint-plugin-prettier";
7+
import importPlugin from "eslint-plugin-import";
8+
import jsxA11y from "eslint-plugin-jsx-a11y";
9+
10+
export default tseslint.config(
11+
{ ignores: ["dist"] },
12+
{
13+
extends: [
14+
js.configs.recommended,
15+
...tseslint.configs.recommended,
16+
"prettier",
17+
],
18+
files: ["**/*.{ts,tsx}"],
19+
languageOptions: {
20+
ecmaVersion: 2020,
21+
globals: {
22+
...globals.browser,
23+
React: "readonly",
24+
},
25+
parser: tseslint.parser,
26+
parserOptions: {
27+
project: "./tsconfig.json",
28+
},
29+
},
30+
plugins: {
31+
"react-hooks": reactHooks,
32+
"react-refresh": reactRefresh,
33+
prettier,
34+
import: importPlugin,
35+
"jsx-a11y": jsxA11y,
36+
},
37+
rules: {
38+
...reactHooks.configs.recommended.rules,
39+
"react-refresh/only-export-components": [
40+
"warn",
41+
{ allowConstantExport: true },
42+
],
43+
"prettier/prettier": "error",
44+
"import/order": [
45+
"error",
46+
{
47+
groups: ["builtin", "external", "internal"],
48+
"newlines-between": "always",
49+
alphabetize: { order: "asc" },
50+
},
51+
],
52+
"jsx-a11y/alt-text": "error",
53+
},
54+
settings: {
55+
"import/resolver": {
56+
typescript: true,
57+
node: true,
58+
},
59+
},
60+
}
61+
);

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>

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "frontend",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview",
11+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
12+
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\""
13+
},
14+
"dependencies": {
15+
"@emotion/react": "^11.14.0",
16+
"@emotion/styled": "^11.14.0",
17+
"@mdx-js/mdx": "^3.1.0",
18+
"@mdx-js/react": "^3.1.0",
19+
"@mdx-js/rollup": "^3.1.0",
20+
"@mui/material": "^7.0.2",
21+
"@tanstack/react-query": "^5.72.2",
22+
"eslint-plugin-import": "^2.31.0",
23+
"eslint-plugin-jsx-a11y": "^6.10.2",
24+
"react": "^19.0.0",
25+
"react-dom": "^19.0.0"
26+
},
27+
"devDependencies": {
28+
"@eslint/js": "^9.21.0",
29+
"@types/react": "^19.0.10",
30+
"@types/react-dom": "^19.0.4",
31+
"@typescript-eslint/parser": "^8.29.1",
32+
"@vitejs/plugin-react": "^4.3.4",
33+
"eslint": "^9.21.0",
34+
"eslint-config-prettier": "^10.1.2",
35+
"eslint-plugin-prettier": "^5.2.6",
36+
"eslint-plugin-react-hooks": "^5.1.0",
37+
"eslint-plugin-react-refresh": "^0.4.19",
38+
"globals": "^15.15.0",
39+
"prettier": "^3.5.3",
40+
"typescript": "~5.7.2",
41+
"typescript-eslint": "^8.24.1",
42+
"vite": "^6.2.0",
43+
"vite-plugin-mdx": "^3.6.1"
44+
}
45+
}

0 commit comments

Comments
 (0)