Skip to content

Commit 302b0a1

Browse files
authored
Merge pull request #58 from microsoft/eslint
Eslint initial
2 parents 759077f + 6faee6b commit 302b0a1

File tree

3 files changed

+1573
-9
lines changed

3 files changed

+1573
-9
lines changed

eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
{
10+
languageOptions: { globals: globals.browser },
11+
settings: {
12+
react: {
13+
version: "detect", // Automatically detect the React version
14+
},
15+
},
16+
},
17+
pluginJs.configs.recommended,
18+
...tseslint.configs.recommended,
19+
pluginReact.configs.flat.recommended,
20+
{
21+
rules: {
22+
"@typescript-eslint/ban-ts-comment": "off",
23+
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
24+
"@typescript-eslint/no-empty-object-type": "off",
25+
"@typescript-eslint/no-explicit-any": "off",
26+
"@typescript-eslint/no-unused-expressions": "off",
27+
"@typescript-eslint/no-unused-vars": "off",
28+
"no-empty-pattern": "off",
29+
"no-empty": "off",
30+
"no-var": "off",
31+
"no-unsafe-optional-chaining": "off",
32+
"no-useless-escape": "off",
33+
"prefer-const": "off",
34+
"react/jsx-key": "off",
35+
"react/no-unescaped-entities": "off",
36+
}
37+
}
38+
];

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"vm-browserify": "^1.1.2"
4949
},
5050
"scripts": {
51+
"lint": "eslint -c eslint.config.js src/**/*.{ts,tsx} --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)