@10stars/config 4.1.6 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +95 -158
- package/package.json +6 -6
package/.eslintrc.js
CHANGED
|
@@ -50,7 +50,7 @@ module.exports = {
|
|
|
50
50
|
`@typescript-eslint`,
|
|
51
51
|
`import`,
|
|
52
52
|
`react`,
|
|
53
|
-
`react-hooks`,
|
|
53
|
+
`react-hooks`, // https://reactjs.org/docs/hooks-rules.html#eslint-plugin
|
|
54
54
|
`regexp`,
|
|
55
55
|
`simple-import-sort`,
|
|
56
56
|
`sort-keys-fix`,
|
|
@@ -88,11 +88,19 @@ module.exports = {
|
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
rules: {
|
|
91
|
-
|
|
91
|
+
/**
|
|
92
|
+
* ESLint core rules
|
|
93
|
+
*/
|
|
94
|
+
"no-case-declarations": type.ignore, // TypeScript shows us error, if the variable is reused in the same scope, so this rule is not applicable
|
|
95
|
+
/**
|
|
96
|
+
* eslint-plugin-import @see https://github.com/benmosher/eslint-plugin-import
|
|
97
|
+
*/
|
|
92
98
|
"import/order": type.ignore, // turn off in favor of eslint-plugin-simple-import-sort
|
|
93
99
|
"import/no-unresolved": type.ignore,
|
|
94
100
|
"import/no-duplicates": type.warning,
|
|
95
|
-
|
|
101
|
+
/**
|
|
102
|
+
* eslint-plugin-simple-import-sort
|
|
103
|
+
*/
|
|
96
104
|
"sort-imports": type.ignore, // we use eslint-plugin-import instead
|
|
97
105
|
"simple-import-sort/imports": type.warning,
|
|
98
106
|
"simple-import-sort/exports": type.warning,
|
|
@@ -103,6 +111,10 @@ module.exports = {
|
|
|
103
111
|
"react/no-children-prop": type.ignore,
|
|
104
112
|
"react/prop-types": type.ignore,
|
|
105
113
|
"react/react-in-jsx-scope": type.ignore,
|
|
114
|
+
"react/jsx-filename-extension": [
|
|
115
|
+
type.warning,
|
|
116
|
+
{ extensions: [`.jsx`, `.tsx`] },
|
|
117
|
+
], // also want to use with ".tsx"
|
|
106
118
|
/**
|
|
107
119
|
* Hooks
|
|
108
120
|
*/
|
|
@@ -114,173 +126,98 @@ module.exports = {
|
|
|
114
126
|
],
|
|
115
127
|
/**
|
|
116
128
|
* TypeScript
|
|
129
|
+
* List of ignored (not recommended) rules we also explored:
|
|
130
|
+
* - @typescript-eslint/consistent-type-assertions
|
|
131
|
+
* - @typescript-eslint/explicit-module-boundary-types
|
|
132
|
+
* - @typescript-eslint/no-parameter-properties
|
|
133
|
+
* - @typescript-eslint/no-require-imports
|
|
134
|
+
* - @typescript-eslint/no-type-alias
|
|
135
|
+
* - @typescript-eslint/no-unnecessary-condition
|
|
136
|
+
* - @typescript-eslint/strict-boolean-expressions // doesn't work well
|
|
117
137
|
*/
|
|
118
|
-
// recommended rules
|
|
119
|
-
"@typescript-eslint/explicit-module-boundary-types": type.ignore,
|
|
138
|
+
// disabled recommended rules
|
|
120
139
|
"@typescript-eslint/no-unused-vars": type.ignore, // removed by bundler, so it shouldn't be a rule
|
|
121
140
|
"@typescript-eslint/no-empty-function": type.ignore, // used for prototyping
|
|
122
|
-
"@typescript-eslint/no-
|
|
141
|
+
"@typescript-eslint/no-explicit-any": type.ignore,
|
|
142
|
+
"@typescript-eslint/ban-types": type.ignore,
|
|
143
|
+
// ---- we ignore these "no-unsafe-*" as it noticeably slows down the code writing
|
|
144
|
+
"@typescript-eslint/no-unsafe-assignment": type.ignore,
|
|
123
145
|
"@typescript-eslint/no-unsafe-member-access": type.ignore,
|
|
124
|
-
"@typescript-eslint/
|
|
146
|
+
"@typescript-eslint/no-unsafe-return": type.ignore,
|
|
125
147
|
"@typescript-eslint/no-non-null-assertion": type.ignore, // sometimes TS incorrectly asserts, so there's a need to override
|
|
148
|
+
"@typescript-eslint/unbound-method": type.ignore,
|
|
149
|
+
// other
|
|
150
|
+
quotes: type.ignore,
|
|
151
|
+
"@typescript-eslint/array-type": [type.warning, { default: `array` }],
|
|
152
|
+
"@typescript-eslint/quotes": [type.warning, `backtick`],
|
|
153
|
+
"@typescript-eslint/consistent-type-definitions": [
|
|
154
|
+
type.warning, // @see https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces
|
|
155
|
+
`type`, // there are many drawbacks in using `interface` over `type`. It saves time to use `type` everywhere
|
|
156
|
+
],
|
|
157
|
+
"@typescript-eslint/naming-convention": [
|
|
158
|
+
type.error,
|
|
159
|
+
{
|
|
160
|
+
selector: `variable`,
|
|
161
|
+
types: [`boolean`],
|
|
162
|
+
format: [`PascalCase`],
|
|
163
|
+
prefix: [`is`, `should`, `has`, `can`, `did`, `will`],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
"no-magic-numbers": type.ignore,
|
|
167
|
+
"@typescript-eslint/no-magic-numbers": [
|
|
168
|
+
type.warning,
|
|
169
|
+
{
|
|
170
|
+
ignore: allowedMagicNumbers,
|
|
171
|
+
ignoreNumericLiteralTypes: true,
|
|
172
|
+
ignoreEnums: true,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
"@typescript-eslint/no-unnecessary-type-arguments": type.warning,
|
|
176
|
+
"@typescript-eslint/unified-signatures": type.warning,
|
|
177
|
+
// string
|
|
178
|
+
"@typescript-eslint/prefer-string-starts-ends-with": type.warning,
|
|
179
|
+
// RegExp
|
|
180
|
+
"@typescript-eslint/prefer-regexp-exec": type.warning,
|
|
181
|
+
// array
|
|
182
|
+
"@typescript-eslint/prefer-includes": type.warning,
|
|
183
|
+
"@typescript-eslint/require-array-sort-compare": type.warning,
|
|
184
|
+
// loops
|
|
185
|
+
"@typescript-eslint/prefer-for-of": type.warning,
|
|
186
|
+
// promises
|
|
126
187
|
"@typescript-eslint/no-misused-promises": [
|
|
127
188
|
type.warning,
|
|
128
189
|
{ checksVoidReturn: false },
|
|
129
190
|
],
|
|
130
|
-
|
|
191
|
+
"@typescript-eslint/no-floating-promises": [
|
|
192
|
+
type.warning,
|
|
193
|
+
{ ignoreVoid: true },
|
|
194
|
+
],
|
|
195
|
+
// namespace
|
|
196
|
+
"@typescript-eslint/no-unnecessary-qualifier": type.warning,
|
|
197
|
+
// for classes
|
|
198
|
+
"@typescript-eslint/no-extraneous-class": type.warning,
|
|
199
|
+
"@typescript-eslint/explicit-member-accessibility": type.warning,
|
|
200
|
+
"@typescript-eslint/member-ordering": [
|
|
201
|
+
type.warning,
|
|
202
|
+
{
|
|
203
|
+
default: [
|
|
204
|
+
`public-static-field`,
|
|
205
|
+
`public-instance-field`,
|
|
206
|
+
`public-constructor`,
|
|
207
|
+
`private-static-field`,
|
|
208
|
+
`private-instance-field`,
|
|
209
|
+
`private-constructor`,
|
|
210
|
+
`public-instance-method`,
|
|
211
|
+
`protected-instance-method`,
|
|
212
|
+
`private-instance-method`,
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
"no-useless-constructor": type.ignore,
|
|
217
|
+
"@typescript-eslint/no-useless-constructor": type.warning,
|
|
131
218
|
/**
|
|
132
219
|
* Regex
|
|
133
220
|
*/
|
|
134
|
-
// extra rules for regex
|
|
135
221
|
"regexp/no-useless-escape": type.warning,
|
|
136
|
-
|
|
137
|
-
// "@typescript-eslint/adjacent-overload-signatures": type.warning,
|
|
138
|
-
// "@typescript-eslint/array-type": [type.warning, { default: `array` }],
|
|
139
|
-
// "@typescript-eslint/await-thenable": type.warning,
|
|
140
|
-
// "@typescript-eslint/ban-ts-ignore": type.ignore,
|
|
141
|
-
// // "@typescript-eslint/ban-types",
|
|
142
|
-
// "brace-style": type.ignore,
|
|
143
|
-
// "@typescript-eslint/brace-style": [
|
|
144
|
-
// type.warning,
|
|
145
|
-
// `1tbs`,
|
|
146
|
-
// { allowSingleLine: true },
|
|
147
|
-
// ],
|
|
148
|
-
// "@typescript-eslint/class-name-casing": type.ignore, // we disable it to allow TS interfaces to be any case
|
|
149
|
-
// "@typescript-eslint/consistent-type-assertions": [
|
|
150
|
-
// type.warning,
|
|
151
|
-
// { assertionStyle: `as`, objectLiteralTypeAssertions: `never` },
|
|
152
|
-
// ],
|
|
153
|
-
// "@typescript-eslint/consistent-type-definitions": [
|
|
154
|
-
// type.warning,
|
|
155
|
-
// `interface`,
|
|
156
|
-
// ],
|
|
157
|
-
// "@typescript-eslint/explicit-function-return-type": type.ignore,
|
|
158
|
-
// "@typescript-eslint/explicit-member-accessibility": type.warning,
|
|
159
|
-
// "func-call-spacing": type.ignore,
|
|
160
|
-
// "@typescript-eslint/func-call-spacing": type.ignore, // prettier has it
|
|
161
|
-
// "@typescript-eslint/generic-type-naming": type.ignore,
|
|
162
|
-
// "@typescript-eslint/indent": type.ignore, // prettier has it
|
|
163
|
-
// "@typescript-eslint/interface-name-prefix": type.ignore, // we want the types to have ability to be named exactly as values
|
|
164
|
-
// // "@typescript-eslint/member-delimiter-style": [
|
|
165
|
-
// // type.warning,
|
|
166
|
-
// // { delimiter: `none`, requireLast: false },
|
|
167
|
-
// // ],
|
|
168
|
-
// "@typescript-eslint/member-delimiter-style": type.ignore,
|
|
169
|
-
// "@typescript-eslint/member-ordering": [
|
|
170
|
-
// type.warning,
|
|
171
|
-
// {
|
|
172
|
-
// default: [
|
|
173
|
-
// `public-static-field`,
|
|
174
|
-
// `public-instance-field`,
|
|
175
|
-
// `public-constructor`,
|
|
176
|
-
// `private-static-field`,
|
|
177
|
-
// `private-instance-field`,
|
|
178
|
-
// `private-constructor`,
|
|
179
|
-
// `public-instance-method`,
|
|
180
|
-
// `protected-instance-method`,
|
|
181
|
-
// `private-instance-method`,
|
|
182
|
-
// ],
|
|
183
|
-
// },
|
|
184
|
-
// ],
|
|
185
|
-
// // "@typescript-eslint/camelcase": [
|
|
186
|
-
// // type.warning,
|
|
187
|
-
// // { properties: `never`, ignoreDestructuring: true },
|
|
188
|
-
// // ],
|
|
189
|
-
// // "@typescript-eslint/naming-convention": [
|
|
190
|
-
// // type.error,
|
|
191
|
-
// // {
|
|
192
|
-
// // selector: `variable`,
|
|
193
|
-
// // types: [`boolean`],
|
|
194
|
-
// // format: [`PascalCase`],
|
|
195
|
-
// // prefix: [`is`, `should`, `has`, `can`, `did`, `will`],
|
|
196
|
-
// // },
|
|
197
|
-
// // ],
|
|
198
|
-
// "@typescript-eslint/no-array-constructor": type.ignore,
|
|
199
|
-
// "no-empty-function": type.ignore,
|
|
200
|
-
// "@typescript-eslint/no-empty-function": type.ignore,
|
|
201
|
-
// "@typescript-eslint/no-empty-interface": [
|
|
202
|
-
// type.warning,
|
|
203
|
-
// { allowSingleExtends: true },
|
|
204
|
-
// ],
|
|
205
|
-
// "@typescript-eslint/no-explicit-any": type.ignore,
|
|
206
|
-
// "no-extra-parens": type.ignore,
|
|
207
|
-
// "@typescript-eslint/no-extra-parens": type.ignore,
|
|
208
|
-
// "@typescript-eslint/no-extraneous-class": type.warning,
|
|
209
|
-
// "@typescript-eslint/no-floating-promises": [
|
|
210
|
-
// type.warning,
|
|
211
|
-
// { ignoreVoid: true },
|
|
212
|
-
// ],
|
|
213
|
-
// "@typescript-eslint/no-for-in-array": type.warning,
|
|
214
|
-
// "@typescript-eslint/no-inferrable-types": type.warning,
|
|
215
|
-
// "no-magic-numbers": type.ignore,
|
|
216
|
-
// "@typescript-eslint/no-magic-numbers": [
|
|
217
|
-
// type.warning,
|
|
218
|
-
// {
|
|
219
|
-
// ignore: allowedMagicNumbers,
|
|
220
|
-
// ignoreNumericLiteralTypes: true,
|
|
221
|
-
// ignoreEnums: true,
|
|
222
|
-
// },
|
|
223
|
-
// ],
|
|
224
|
-
// "@typescript-eslint/no-misused-new": type.warning,
|
|
225
|
-
// "@typescript-eslint/no-namespace": type.warning,
|
|
226
|
-
// "@typescript-eslint/no-non-null-assertion": type.warning,
|
|
227
|
-
// "@typescript-eslint/no-parameter-properties": type.warning,
|
|
228
|
-
// "@typescript-eslint/no-require-imports": type.ignore,
|
|
229
|
-
// "@typescript-eslint/no-this-alias": type.warning,
|
|
230
|
-
// "@typescript-eslint/no-type-alias": type.ignore,
|
|
231
|
-
// "@typescript-eslint/no-unnecessary-condition": type.ignore, // doesn't work well
|
|
232
|
-
// "@typescript-eslint/no-unnecessary-qualifier": type.warning,
|
|
233
|
-
// "@typescript-eslint/no-unnecessary-type-arguments": type.warning,
|
|
234
|
-
// "@typescript-eslint/no-unnecessary-type-assertion": type.warning,
|
|
235
|
-
// "@typescript-eslint/no-unused-vars": type.ignore,
|
|
236
|
-
// "@typescript-eslint/no-use-before-define": type.warning,
|
|
237
|
-
// "no-useless-constructor": type.ignore,
|
|
238
|
-
// "@typescript-eslint/no-useless-constructor": type.warning,
|
|
239
|
-
// "@typescript-eslint/no-var-requires": type.warning,
|
|
240
|
-
// "@typescript-eslint/prefer-for-of": type.warning,
|
|
241
|
-
// "@typescript-eslint/prefer-function-type": type.warning,
|
|
242
|
-
// "@typescript-eslint/prefer-includes": type.warning,
|
|
243
|
-
// "@typescript-eslint/prefer-namespace-keyword": type.ignore,
|
|
244
|
-
// "@typescript-eslint/prefer-readonly": type.warning,
|
|
245
|
-
// "@typescript-eslint/prefer-regexp-exec": type.warning,
|
|
246
|
-
// "@typescript-eslint/prefer-string-starts-ends-with": type.warning,
|
|
247
|
-
// "@typescript-eslint/promise-function-async": type.warning,
|
|
248
|
-
// quotes: type.ignore,
|
|
249
|
-
// "@typescript-eslint/quotes": [type.warning, `backtick`],
|
|
250
|
-
// "@typescript-eslint/require-array-sort-compare": type.warning,
|
|
251
|
-
// "require-await": type.ignore,
|
|
252
|
-
// "@typescript-eslint/require-await": type.warning,
|
|
253
|
-
// "@typescript-eslint/restrict-plus-operands": type.ignore,
|
|
254
|
-
// semi: type.ignore,
|
|
255
|
-
// "@typescript-eslint/semi": type.ignore,
|
|
256
|
-
// "@typescript-eslint/strict-boolean-expressions": type.ignore, // doesn't work well
|
|
257
|
-
// // "@typescript-eslint/strict-boolean-expressions": [
|
|
258
|
-
// // type.warning,
|
|
259
|
-
// // { allowNullable: true, ignoreRhs: true },
|
|
260
|
-
// // ],
|
|
261
|
-
// "@typescript-eslint/triple-slash-reference": [
|
|
262
|
-
// type.warning,
|
|
263
|
-
// { path: `never`, types: `never`, lib: `never` },
|
|
264
|
-
// ],
|
|
265
|
-
// "@typescript-eslint/type-annotation-spacing": type.ignore,
|
|
266
|
-
// "@typescript-eslint/typedef": type.ignore,
|
|
267
|
-
// "@typescript-eslint/unbound-method": type.warning,
|
|
268
|
-
// "@typescript-eslint/unified-signatures": type.warning,
|
|
269
|
-
|
|
270
|
-
// // These rules don't add much value, are better covered by TypeScript and good definition files
|
|
271
|
-
// "react/no-direct-mutation-state": type.ignore,
|
|
272
|
-
// "react/no-deprecated": type.ignore,
|
|
273
|
-
// "react/no-string-refs": type.ignore,
|
|
274
|
-
// "react/require-render-return": type.ignore,
|
|
275
|
-
|
|
276
|
-
// "react/jsx-filename-extension": [
|
|
277
|
-
// type.warning,
|
|
278
|
-
// { extensions: [`.jsx`, `.tsx`] },
|
|
279
|
-
// ], // also want to use with ".tsx"
|
|
280
|
-
// "react/prop-types": type.ignore, // Is this incompatible with TS props type?
|
|
281
|
-
|
|
282
|
-
// // https://reactjs.org/docs/hooks-rules.html#eslint-plugin
|
|
283
|
-
// "react-hooks/rules-of-hooks": type.error, // Checks rules of Hooks
|
|
284
|
-
// "react-hooks/exhaustive-deps": type.warning, // Checks effect dependencies
|
|
285
222
|
},
|
|
286
223
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
},
|
|
6
6
|
"name": "@10stars/config",
|
|
7
7
|
"description": "10stars.dev Shareable Configs",
|
|
8
|
-
"version": "4.
|
|
8
|
+
"version": "4.2.0",
|
|
9
9
|
"author": "10stars.dev <web@alexandrov.co> (https://alexandrov.co)",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"config"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"lint-rule-timings": "cross-env TIMING=1 npm run lint"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@commitlint/cli": "^
|
|
28
|
-
"@commitlint/config-conventional": "^
|
|
27
|
+
"@commitlint/cli": "^15.0.0",
|
|
28
|
+
"@commitlint/config-conventional": "^15.0.0",
|
|
29
29
|
"@types/aws-lambda": "^8.0.0",
|
|
30
30
|
"@types/jest": "^27.0.0",
|
|
31
31
|
"@types/lodash": "^4.0.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/react": "^17.0.0",
|
|
34
34
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
35
35
|
"@typescript-eslint/parser": "^5.0.0",
|
|
36
|
-
"esbuild": "~0.13.
|
|
36
|
+
"esbuild": "~0.13.15",
|
|
37
37
|
"esbuild-register": "^3.0.0",
|
|
38
38
|
"eslint": "^8.0.0",
|
|
39
39
|
"eslint-config-prettier": "^8.0.0",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"eslint-plugin-regexp": "^1.0.0",
|
|
44
44
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
45
45
|
"eslint-plugin-sort-keys-fix": "^1.0.0",
|
|
46
|
-
"eslint-watch": "
|
|
46
|
+
"eslint-watch": "8.0.0",
|
|
47
47
|
"husky": "^7.0.0",
|
|
48
48
|
"nodemon": "^2.0.7",
|
|
49
49
|
"prettier": "^2.0.0",
|
|
50
50
|
"type-fest": "^2.0.0",
|
|
51
|
-
"typescript": "^4.
|
|
51
|
+
"typescript": "^4.5.2"
|
|
52
52
|
}
|
|
53
53
|
}
|