-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
63 lines (61 loc) · 1.68 KB
/
eslint.config.mjs
File metadata and controls
63 lines (61 loc) · 1.68 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import pluginJsxAlly from "eslint-plugin-jsx-a11y";
import reactHooks from "eslint-plugin-react-hooks";
import pluginImport from "eslint-plugin-import";
/** @type {import('eslint').Linter.Config[]} */
export default [
pluginJs.configs.recommended,
pluginReact.configs.flat.recommended,
pluginJsxAlly.flatConfigs.recommended,
pluginImport.flatConfigs.recommended,
eslintConfigPrettier,
{
languageOptions: { globals: globals.browser, ecmaVersion: "latest" },
files: ["**/*.{js,mjs,cjs,jsx}"],
linterOptions: {
reportUnusedDisableDirectives: "error",
},
plugins: {
js: pluginJs,
"react-hooks": reactHooks,
react: pluginReact,
},
ignores: ["dist"],
settings: {
react: {
version: "detect",
},
globals: {
vi: true,
},
"import/ignore": [
"src/util/*.js$"
]
},
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-unused-vars": [
"error",
{
vars: "all",
args: "after-used",
ignoreRestSiblings: true,
argsIgnorePattern: "^_",
},
],
"react/react-in-jsx-scope": "off",
"react/prop-types": "warn",
"import/namespace": "off",
"import/no-unresolved": "off",
"import/order": "error",
"import/no-duplicates": "error",
"import/default": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off"
},
},
];