-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
49 lines (48 loc) · 1.44 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import pluginJs from "@eslint/js";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginReactRefresh from "eslint-plugin-react-refresh";
import pluginReactJsxRuntimeConfig from "eslint-plugin-react/configs/jsx-runtime.js";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import globals from "globals";
import tseslint from "typescript-eslint";
/** @type { import("eslint").Linter.FlatConfig[] } */
export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{
ignores: [
"vite.config.ts",
"eslint.config.js",
"src/ising.*",
"node_modules/**",
"dist/**",
],
},
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parserOptions: {
project: "./tsconfig.app.json",
sourceType: "module",
},
},
plugins: {
"react-hooks": fixupPluginRules(pluginReactHooks),
"react-refresh": pluginReactRefresh,
},
rules: {
...pluginReactHooks.configs.recommended.rules,
"@typescript-eslint/consistent-type-imports": "error",
"react-refresh/only-export-components": "warn",
},
settings: {
react: {
version: "detect",
},
},
},
pluginJs.configs.recommended,
...tseslint.configs.strictTypeChecked,
...fixupConfigRules(pluginReactConfig),
...fixupConfigRules(pluginReactJsxRuntimeConfig),
];