Skip to content

Commit 69f78e6

Browse files
committed
chore: lint
1 parent 0c0dc3d commit 69f78e6

File tree

5 files changed

+76
-103
lines changed

5 files changed

+76
-103
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 50 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import antfu from "@antfu/eslint-config";
2+
import tailwind from "eslint-plugin-tailwindcss";
3+
4+
export default antfu({
5+
formatters: false,
6+
react: true,
7+
ignores: ["README.md"],
8+
typescript: {
9+
tsconfigPath: "tsconfig.json",
10+
},
11+
globals: {
12+
process: true,
13+
},
14+
stylistic: {
15+
quotes: "double", // or 'double'
16+
semi: true,
17+
overrides: {
18+
"style/comma-dangle": "off",
19+
},
20+
},
21+
rules: {
22+
"ts/no-namespace": 0,
23+
"ts/no-unsafe-call": 0,
24+
"ts/no-unsafe-return": 0,
25+
"ts/no-unsafe-argument": 0,
26+
"ts/no-misused-promises": 0,
27+
"ts/no-floating-promises": 0,
28+
"ts/no-unsafe-assignment": 0,
29+
"ts/no-unsafe-member-access": 0,
30+
"ts/strict-boolean-expressions": 0,
31+
"ts/switch-exhaustiveness-check": 0,
32+
"react-hooks-extra/no-direct-set-state-in-use-effect": 0,
33+
"n/prefer-global/process": 0, // Allow process in browser context
34+
},
35+
}, ...tailwind.configs["flat/recommended"]);

package.json

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,63 @@
11
{
22
"name": "react-admin-tp",
3+
"type": "module",
34
"version": "1.0.1",
45
"description": "react-ts 后台管理系统项目模版内置菜单路由、状态管理多环境打包等工具开箱即用",
5-
"main": "index.js",
6-
"type": "module",
6+
"author": "wanpan11",
7+
"license": "ISC",
8+
"homepage": "https://wanpan11.github.io/react-admin-tp/",
79
"keywords": [
810
"react",
911
"admin",
1012
"typescript"
1113
],
12-
"author": "wanpan11",
13-
"license": "ISC",
14-
"homepage": "https://wanpan11.github.io/react-admin-tp/",
14+
"main": "index.js",
1515
"scripts": {
1616
"start": "cross-env NODE_ENV=development webpack serve -c ./scripts/webpack.config.cjs --mode development",
1717
"build": "cross-env NODE_ENV=production webpack -c ./scripts/webpack.config.cjs --mode production",
1818
"build:homepage": "cross-env NODE_ENV=homepage webpack -c ./scripts/webpack.config.cjs --mode production",
1919
"dev:build": "cross-env NODE_ENV=development webpack -c ./scripts/webpack.config.cjs --mode development",
20-
"lint": "eslint --fix --ext js,jsx,ts,tsx src/ && tsc --noEmit",
20+
"lint": "eslint --fix && tsc --noEmit",
2121
"prepare": "husky install"
2222
},
23+
"dependencies": {
24+
"@ant-design/icons": "^5.3.4",
25+
"@babel/runtime": "^7.24.0",
26+
"@unocss/reset": "^0.53.6",
27+
"antd": "^5.15.3",
28+
"axios": "^1.6.8",
29+
"classnames": "^2.5.1",
30+
"core-js": "^3.36.0",
31+
"nanoid": "^4.0.2",
32+
"react": "^18.2.0",
33+
"react-dom": "^18.2.0",
34+
"react-router-dom": "^6.22.3",
35+
"swr": "^2.3.3",
36+
"zustand": "^5.0.5"
37+
},
2338
"devDependencies": {
39+
"@antfu/eslint-config": "^4.15.0",
2440
"@babel/core": "^7.24.0",
2541
"@babel/plugin-transform-runtime": "^7.24.0",
2642
"@babel/preset-env": "^7.24.0",
2743
"@babel/preset-react": "^7.23.3",
2844
"@babel/preset-typescript": "^7.23.3",
29-
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
45+
"@eslint-react/eslint-plugin": "^1.52.2",
3046
"@types/mockjs": "^1.0.10",
3147
"@types/node": "^18.19.24",
3248
"@types/react": "^18.2.66",
3349
"@types/react-dom": "^18.2.22",
34-
"@typescript-eslint/eslint-plugin": "^8.28.0",
35-
"@typescript-eslint/parser": "^8.28.0",
3650
"autoprefixer": "^10.4.18",
3751
"babel-loader": "^8.3.0",
3852
"cross-env": "^7.0.3",
3953
"css-loader": "^6.10.0",
4054
"cssnano": "^6.1.0",
4155
"dotenv": "^16.4.5",
42-
"eslint": "^8.57.0",
43-
"eslint-plugin-prettier": "^4.2.1",
44-
"eslint-plugin-react": "^7.34.1",
45-
"eslint-plugin-react-hooks": "^4.6.0",
56+
"eslint": "^9.29.0",
57+
"eslint-plugin-format": "^1.0.1",
58+
"eslint-plugin-react-hooks": "^5.2.0",
59+
"eslint-plugin-react-refresh": "^0.4.20",
60+
"eslint-plugin-tailwindcss": "^3.18.0",
4661
"html-webpack-plugin": "^5.6.0",
4762
"husky": "^8.0.3",
4863
"less": "^4.2.0",
@@ -52,8 +67,6 @@
5267
"mockjs": "^1.1.0",
5368
"postcss": "^8.4.36",
5469
"postcss-loader": "^7.3.4",
55-
"prettier": "2.5.1",
56-
"prettier-plugin-tailwindcss": "^0.3.0",
5770
"style-loader": "^3.3.4",
5871
"tailwindcss": "^3.4.1",
5972
"typescript": "^5.8.2",
@@ -62,28 +75,10 @@
6275
"webpack-cli": "^4.10.0",
6376
"webpack-dev-server": "^4.15.1"
6477
},
65-
"dependencies": {
66-
"@ant-design/icons": "^5.3.4",
67-
"@babel/runtime": "^7.24.0",
68-
"@unocss/reset": "^0.53.6",
69-
"antd": "^5.15.3",
70-
"axios": "^1.6.8",
71-
"classnames": "^2.5.1",
72-
"core-js": "^3.36.0",
73-
"nanoid": "^4.0.2",
74-
"react": "^18.2.0",
75-
"react-dom": "^18.2.0",
76-
"react-router-dom": "^6.22.3",
77-
"swr": "^2.3.3",
78-
"zustand": "^5.0.5"
79-
},
8078
"lint-staged": {
8179
"*.{js,jsx,ts,tsx}": [
8280
"eslint --fix",
8381
"bash -c tsc --noEmit"
84-
],
85-
"*.md": [
86-
"prettier --write"
8782
]
8883
}
8984
}

prettier.config.cjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tsconfig.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"compilerOptions": {
33
"target": "esnext",
4+
"jsx": "react-jsx",
45
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"esModuleInterop": true,
8-
"allowSyntheticDefaultImports": true,
9-
"strict": true,
10-
"forceConsistentCasingInFileNames": true,
6+
"baseUrl": ".",
117
"module": "esnext",
128
"moduleResolution": "node",
13-
"resolveJsonModule": true,
14-
"isolatedModules": true,
15-
"noEmit": true,
16-
"jsx": "react-jsx",
17-
"baseUrl": ".",
189
"paths": {
1910
"&src/*": ["./src/*"]
20-
}
11+
},
12+
"resolveJsonModule": true,
13+
"allowJs": true,
14+
"strict": true,
15+
"noEmit": true,
16+
"allowSyntheticDefaultImports": true,
17+
"esModuleInterop": true,
18+
"forceConsistentCasingInFileNames": true,
19+
"isolatedModules": true,
20+
"skipLibCheck": true
2121
},
22-
"include": ["src"]
22+
"include": ["src", "scripts"]
2323
}

0 commit comments

Comments
 (0)