Skip to content

Commit 2df7649

Browse files
committed
add eslint
1 parent 8697bb8 commit 2df7649

File tree

3 files changed

+1556
-9
lines changed

3 files changed

+1556
-9
lines changed

eslint.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import pluginReact from "eslint-plugin-react";
5+
6+
7+
/** @type {import('eslint').Linter.Config[]} */
8+
export default [
9+
{ files: ["src/**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
10+
{
11+
languageOptions: { globals: globals.browser },
12+
settings: {
13+
react: {
14+
version: "detect", // Automatically detect the React version
15+
},
16+
},
17+
},
18+
pluginJs.configs.recommended,
19+
...tseslint.configs.recommended,
20+
pluginReact.configs.flat.recommended,
21+
];

package.json

+8
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"vm-browserify": "^1.1.2"
4949
},
5050
"scripts": {
51+
"eslint": "eslint --fix",
5152
"start": "vite",
5253
"build": "vite build"
5354
},
@@ -64,14 +65,21 @@
6465
]
6566
},
6667
"devDependencies": {
68+
"@eslint/js": "^9.15.0",
6769
"@types/d3": "^7.4.3",
6870
"@types/lodash": "^4.17.7",
6971
"@types/node": "^20.14.10",
7072
"@types/prismjs": "^1.26.0",
7173
"@types/react": "^18.3.3",
7274
"@types/react-dom": "^18.3.0",
75+
"@typescript-eslint/eslint-plugin": "^8.16.0",
76+
"@typescript-eslint/parser": "^8.16.0",
7377
"@vitejs/plugin-react-swc": "^3.7.0",
78+
"eslint": "^9.15.0",
79+
"eslint-plugin-react": "^7.37.2",
80+
"globals": "^15.12.0",
7481
"sass": "^1.77.6",
82+
"typescript-eslint": "^8.16.0",
7583
"vite": "^5.3.6"
7684
}
7785
}

0 commit comments

Comments
 (0)