-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
156 lines (156 loc) · 3.99 KB
/
.eslintrc.json
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"extends": ["airbnb"],
"settings": {
"import/resolver": {
"webpack": {}
},
"react": {
"version": "16.3.0"
}
},
"env": {
"browser": true,
"node": true,
"es6": true,
"jquery": true
},
"plugins": ["react-hooks", "no-only-tests"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{
"peerDependencies": true
}
],
"import/no-unresolved": ["error", { "ignore": ["react", "react-dom", "stripes-config"] }],
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/label-has-for": [
"error",
{
"required": {
"some": ["nesting", "id"]
},
"allowChildren": false
}
],
"jsx-a11y/no-noninteractive-tabindex": [
"error",
{
"tags": [],
"roles": ["tabpanel", "dialog"]
}
],
"key-spacing": "off",
"linebreak-style": "off",
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"no-await-in-loop": "off",
"no-console": "warn",
"no-else-return": "off",
"no-multiple-empty-lines": "off",
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"no-nested-ternary": "off",
"no-only-tests/no-only-tests": "error",
"no-param-reassign": [
"error",
{
"props": false
}
],
"no-plusplus": "off",
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
"no-underscore-dangle": "off",
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "React"
}
],
"object-curly-newline": ["error", { "consistent": true }],
"operator-linebreak": ["off"],
"prefer-destructuring": "off",
"prefer-template": "off",
"quote-props": "off",
"react/destructuring-assignment": ["off"],
"react/forbid-prop-types": [
"warn",
{
"forbid": ["any", "array"]
}
],
"react/jsx-curly-newline": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-uses-react": "off",
"react/jsx-wrap-multilines": "off",
"react/no-array-index-key": "off",
"react/prefer-stateless-function": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"react/sort-comp": [
"warn",
{
"order": ["static-methods", "static-variables", "lifecycle", "everything-else", "render"]
}
],
"react/state-in-constructor": "off",
"react/static-property-placement": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"max-len": ["warn", 120],
"no-return-assign": "off",
"comma-dangle": "off",
"no-invalid-this": "error",
"quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": false }],
"implicit-arrow-linebreak": "off",
"function-paren-newline": "off",
"import/no-named-as-default": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"import/no-cycle": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript"
],
"rules": {
// must disable the traditional rule
// as it reports false positive on TS
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"]
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"react/no-unused-prop-types": "off"
}
}
]
}