-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.cjs
69 lines (69 loc) · 1.79 KB
/
.eslintrc.cjs
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
64
65
66
67
68
69
module.exports = {
env: {
browser: true,
jest: true,
},
extends: [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
],
ignorePatterns: ["*.dic.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: { jsx: true },
project: "./tsconfig.json",
},
plugins: ["@typescript-eslint", "react", "unused-imports"],
root: true,
rules: {
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-duplicates": "warn",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/order": [
"warn",
{
alphabetize: { order: "asc" },
groups: [
"builtin",
"external",
["internal", "parent", "sibling", "index", "object", "type"],
],
"newlines-between": "always",
},
],
"no-undef": "off",
"prefer-const": "warn",
"react/jsx-boolean-value": "warn",
"unused-imports/no-unused-imports": "warn",
},
settings: {
react: { version: "detect" },
"import/resolver": {
typescript: { alwaysTryTypes: true },
},
},
overrides: [
{
files: ["*.ts", "*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
],
rules: {
"@typescript-eslint/explicit-function-return-type": [
"warn",
{ allowExpressions: true },
],
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
},
},
],
};