@dr.pogodin/eslint-configs 0.2.3 → 0.2.4
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/config/javascript.js +21 -2
- package/config/typescript.js +3 -3
- package/package.json +1 -1
package/config/javascript.js
CHANGED
|
@@ -24,8 +24,8 @@ function newConfig({ noPerf } = {}) {
|
|
|
24
24
|
'@babel/new-cap': 'error',
|
|
25
25
|
'@babel/no-invalid-this': 'error',
|
|
26
26
|
|
|
27
|
-
'@babel/no-undef': 'error',
|
|
28
27
|
'no-undef': 'off',
|
|
28
|
+
'@babel/no-undef': 'error',
|
|
29
29
|
|
|
30
30
|
'@babel/no-unused-expressions': 'error',
|
|
31
31
|
|
|
@@ -285,6 +285,7 @@ function newConfig({ noPerf } = {}) {
|
|
|
285
285
|
.sortByNaturalSort()
|
|
286
286
|
.placeAllWithCaseBeforeAllWithOtherCase('uppercase')
|
|
287
287
|
.placeCharacterBefore({ characterAfter: '-', characterBefore: '/' })
|
|
288
|
+
.placeCharacterAfter({ characterAfter: '@', characterBefore: 'z' })
|
|
288
289
|
.getCharacters();
|
|
289
290
|
|
|
290
291
|
settings.perfectionist = {
|
|
@@ -294,6 +295,24 @@ function newConfig({ noPerf } = {}) {
|
|
|
294
295
|
newlinesInside: 'ignore',
|
|
295
296
|
partitionByNewLine: true,
|
|
296
297
|
};
|
|
298
|
+
|
|
299
|
+
rules['perfectionist/sort-imports'] = ['error', {
|
|
300
|
+
alphabet,
|
|
301
|
+
groups: [
|
|
302
|
+
'builtin',
|
|
303
|
+
'external',
|
|
304
|
+
'internal',
|
|
305
|
+
'parent',
|
|
306
|
+
'sibling',
|
|
307
|
+
'index',
|
|
308
|
+
'style',
|
|
309
|
+
'unknown',
|
|
310
|
+
],
|
|
311
|
+
newlinesBetween: 1,
|
|
312
|
+
newlinesInside: 'ignore',
|
|
313
|
+
partitionByNewLine: false,
|
|
314
|
+
type: 'custom',
|
|
315
|
+
}];
|
|
297
316
|
}
|
|
298
317
|
|
|
299
318
|
return defineConfig([{
|
|
@@ -307,9 +326,9 @@ function newConfig({ noPerf } = {}) {
|
|
|
307
326
|
},
|
|
308
327
|
name: 'dr.pogodin/javascript',
|
|
309
328
|
plugins: {
|
|
329
|
+
js,
|
|
310
330
|
'@babel': babelPlugin,
|
|
311
331
|
'@stylistic': stylisticPlugin,
|
|
312
|
-
js,
|
|
313
332
|
},
|
|
314
333
|
rules,
|
|
315
334
|
settings,
|
package/config/typescript.js
CHANGED
|
@@ -50,8 +50,8 @@ function newConfig({ noPerf } = {}) {
|
|
|
50
50
|
|
|
51
51
|
// NOTE: The core rule variant reports incorrect errors on TypeScript
|
|
52
52
|
// code, thus disabled.
|
|
53
|
-
'@typescript-eslint/no-shadow': 'error',
|
|
54
53
|
'no-shadow': 'off',
|
|
54
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
55
55
|
|
|
56
56
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
57
57
|
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
@@ -61,8 +61,8 @@ function newConfig({ noPerf } = {}) {
|
|
|
61
61
|
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
62
62
|
|
|
63
63
|
// NOTE: Disables the base rule as it can report incorrect errors.
|
|
64
|
-
'@typescript-eslint/no-unused-private-class-members': 'error',
|
|
65
64
|
'no-unused-private-class-members': 'off',
|
|
65
|
+
'@typescript-eslint/no-unused-private-class-members': 'error',
|
|
66
66
|
|
|
67
67
|
'@typescript-eslint/no-use-before-define': 'error',
|
|
68
68
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
@@ -73,8 +73,8 @@ function newConfig({ noPerf } = {}) {
|
|
|
73
73
|
|
|
74
74
|
// NOTE: The core variant of this rule, disabled below, does not work
|
|
75
75
|
// correctly for TypeScript code in some edge cases.
|
|
76
|
-
'@typescript-eslint/prefer-destructuring': 'error',
|
|
77
76
|
'prefer-destructuring': 'off',
|
|
77
|
+
'@typescript-eslint/prefer-destructuring': 'error',
|
|
78
78
|
|
|
79
79
|
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
80
80
|
'@typescript-eslint/prefer-literal-enum-member': 'error',
|