-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
161 lines (161 loc) · 4.5 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
157
158
159
160
161
{
"root": true,
"env": {
"browser": true,
"node": true,
"jest": true
},
"extends": [
"next/core-web-vitals",
"plugin:testing-library/react",
"plugin:jest-dom/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:import/warnings",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"next",
"next/core-web-vitals",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import", "testing-library"],
"overrides": [
// Only uses Testing Library lint rules in test files
{
"files": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
".ts",
".tsx"
]
}
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/init-declarations": ["error", "always"],
"@typescript-eslint/lines-between-class-members": ["warn"],
"@typescript-eslint/no-array-constructor": ["warn"],
// "@typescript-eslint/no-duplicate-imports": ["warn"],
"@typescript-eslint/no-empty-function": ["warn"],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": [1],
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/prefer-for-of": 2,
"brace-style": "off",
"comma-dangle": "off",
"comma-spacing": "off",
"func-call-spacing": "off",
"import/extensions": "off",
"import/no-cycle": "warn",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"optionalDependencies": false,
"peerDependencies": false
}
],
"import/no-named-as-default": "warn",
"import/no-named-as-default-member": "warn",
"import/no-unresolved": "off",
"import/no-useless-path-segments": "warn",
"import/order": "off",
"import/prefer-default-export": "warn",
"indent": "off",
"init-declarations": "off",
"keyword-spacing": "off",
"lines-between-class-members": "off",
"no-array-constructor": "off",
"no-console": [
"warn",
{
"allow": ["warn", "error"]
}
],
"no-duplicate-imports": "warn",
"no-empty-function": "off",
"no-explicit-any": "off",
"no-extra-parens": "off",
"no-lone-blocks": "warn",
"no-tabs": "off",
"no-unused-vars": "off",
"no-use-before-define": [0],
"no-useless-constructor": "off",
"react/destructuring-assignment": "warn",
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function"
}
],
"react/jsx-curly-brace-presence": "warn",
"react/jsx-filename-extension": "off",
"react/jsx-fragments": [2, "element"],
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-sort-props": [
"warn",
{
"ignoreCase": true,
"reservedFirst": false,
"noSortAlphabetically": true
}
],
"react/no-access-state-in-setstate": "warn",
"react/no-array-index-key": "off",
"react/no-did-update-set-state": "off",
"react/no-find-dom-node": "warn",
"react/no-unused-state": "off",
"react/prefer-stateless-function": [
"warn",
{
"ignorePureComponents": true
}
],
"react/prop-types": "off",
"react/require-default-prop": "off",
"react/require-default-props": "off",
"react/self-closing-comp": "warn",
"react/sort-comp": "warn",
"react/static-property-placement": ["warn", "static public field"],
"settings": {
"import/extensions": [".js", ".json", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".js", ".json", ".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".json", ".ts", ".tsx"],
"moduleDirectory": [
"node_modules",
"pages",
"public",
"src",
"styles"
]
},
"typescript": {
"alwaysTryTypes": true
}
},
"react": {
"version": "detect"
}
}
}
}