@dr.pogodin/eslint-configs 0.2.2 → 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 +28 -6
- package/config/typescript.js +3 -3
- package/package.json +3 -3
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
|
|
|
@@ -281,16 +281,38 @@ function newConfig({ noPerf } = {}) {
|
|
|
281
281
|
// eslint-disable-next-line import/no-named-as-default-member
|
|
282
282
|
extentions.push(perfectionist.configs['recommended-custom']);
|
|
283
283
|
|
|
284
|
+
const alphabet = Alphabet.generateRecommendedAlphabet()
|
|
285
|
+
.sortByNaturalSort()
|
|
286
|
+
.placeAllWithCaseBeforeAllWithOtherCase('uppercase')
|
|
287
|
+
.placeCharacterBefore({ characterAfter: '-', characterBefore: '/' })
|
|
288
|
+
.placeCharacterAfter({ characterAfter: '@', characterBefore: 'z' })
|
|
289
|
+
.getCharacters();
|
|
290
|
+
|
|
284
291
|
settings.perfectionist = {
|
|
285
|
-
alphabet
|
|
286
|
-
.placeAllWithCaseBeforeAllWithOtherCase('uppercase')
|
|
287
|
-
.placeCharacterBefore({ characterAfter: '-', characterBefore: '/' })
|
|
288
|
-
.getCharacters(),
|
|
292
|
+
alphabet,
|
|
289
293
|
ignoreCase: false,
|
|
290
294
|
newlinesBetween: 'ignore',
|
|
291
295
|
newlinesInside: 'ignore',
|
|
292
296
|
partitionByNewLine: true,
|
|
293
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
|
+
}];
|
|
294
316
|
}
|
|
295
317
|
|
|
296
318
|
return defineConfig([{
|
|
@@ -304,9 +326,9 @@ function newConfig({ noPerf } = {}) {
|
|
|
304
326
|
},
|
|
305
327
|
name: 'dr.pogodin/javascript',
|
|
306
328
|
plugins: {
|
|
329
|
+
js,
|
|
307
330
|
'@babel': babelPlugin,
|
|
308
331
|
'@stylistic': stylisticPlugin,
|
|
309
|
-
js,
|
|
310
332
|
},
|
|
311
333
|
rules,
|
|
312
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',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dr.pogodin/eslint-configs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "ESLint configurations for TypeScript and/or React projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./config/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@babel/preset-react": "^7.28.5",
|
|
36
36
|
"@babel/preset-typescript": "^7.28.5",
|
|
37
37
|
"@eslint/js": "^9.39.2",
|
|
38
|
-
"@stylistic/eslint-plugin": "^5.7.
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
39
39
|
"eslint": "^9.39.2",
|
|
40
40
|
"eslint-plugin-import": "^2.32.0",
|
|
41
41
|
"eslint-plugin-jest": "^29.12.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"eslint-plugin-react": "^7.37.4",
|
|
45
45
|
"eslint-plugin-react-hooks": "^6.1.1",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
|
-
"typescript-eslint": "^8.
|
|
47
|
+
"typescript-eslint": "^8.54.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"eslint-import-resolver-typescript": "^4.4.4"
|