-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
117 lines (117 loc) · 3.69 KB
/
.eslintrc
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"extends": [
"airbnb-typescript",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": ["react", "import"],
"settings": {
"import/extensions": [".ts", ".tsx"],
"import/resolver": {
"node": {
"moduleDirectory": ["src"]
}
},
"react": {
"version": "detect"
}
},
"globals": {
"module": "readonly",
"process": "readonly",
"__dirname": "readonly",
"global": "readonly",
"exports": "readonly"
},
"rules": {
// eslint
"no-underscore-dangle": "off",
"no-unreachable-loop": "error",
"no-unsafe-optional-chaining": ["error", { "disallowArithmeticOperators": true }],
"no-useless-backreference": "error",
"default-case-last": "error",
"no-eq-null": "error",
"no-implicit-coercion": "error",
"init-declarations": "error",
"array-bracket-newline": ["error", "consistent"],
"array-element-newline": [
"error",
{ "ArrayExpression": "consistent", "ArrayPattern": { "multiline": true, "minItems": 3 } }
],
"func-style": ["error", "expression"],
"function-call-argument-newline": ["error", "consistent"],
"id-length": ["error", { "min": 2, "max": 40, "exceptions": ["i", "x", "y", "z", "e", "r"] }],
"max-depth": "error",
"max-nested-callbacks": ["error", 3],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var", "import"] },
{
"blankLine": "always",
"prev": "*",
"next": ["return", "export", "for", "if", "switch", "try", "while"]
},
{ "blankLine": "always", "prev": "import", "next": "*" },
{ "blankLine": "any", "prev": "import", "next": "import" },
{ "blankLine": "never", "prev": "*", "next": "case"},
{ "blankLine": "never", "prev": "*", "next": "default"}
],
"prefer-exponentiation-operator": "error",
"no-duplicate-imports": "error",
// react
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/function-component-definition": [
"error",
{ "namedComponents": "arrow-function", "unnamedComponents": "arrow-function" }
],
"react/no-multi-comp": "error",
"react/jsx-no-useless-fragment": "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/no-array-index-key": "off",
// import
"import/default": "error",
"import/namespace": ["error", { "allowComputed": true }],
// "import/no-unused-modules": ["error", { "unusedExports": true }],
"import/no-unused-modules": "off",
"import/order": [
"error",
{
"newlines-between": "always",
"pathGroups": [
{
"pattern": "react",
"group": "builtin",
"position": "before"
}, {
"pattern": "React",
"group": "builtin",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["React", "react"],
"groups": ["builtin", "external", "internal", "index", "object", "unknown", ["parent", "sibling"]]
}
],
"import/no-anonymous-default-export": "error",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/prefer-default-export": "off",
// typescript
"@typescript-eslint/no-unsafe-assignment": "off"
},
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module",
"project": "./tsconfig.json"
}
}