@repodog/eslint-config 9.0.17 → 9.0.19
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/index.mjs +10 -13
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
1
|
+
import { fixupPluginRules } from '@eslint/compat';
|
|
3
2
|
import eslint from '@eslint/js';
|
|
4
3
|
import stylistic from '@stylistic/eslint-plugin';
|
|
4
|
+
import eslintComments from 'eslint-plugin-eslint-comments';
|
|
5
5
|
import { importX } from 'eslint-plugin-import-x';
|
|
6
6
|
import preferArrow from 'eslint-plugin-prefer-arrow';
|
|
7
7
|
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
@@ -16,10 +16,6 @@ import tsEslint from 'typescript-eslint';
|
|
|
16
16
|
const cwd = process.cwd();
|
|
17
17
|
const project = './tsconfig.json';
|
|
18
18
|
|
|
19
|
-
const flatCompat = new FlatCompat({
|
|
20
|
-
baseDirectory: cwd,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
19
|
// eslint convention is to export default
|
|
24
20
|
// eslint-disable-next-line import-x/no-default-export
|
|
25
21
|
export default tsEslint.config(
|
|
@@ -43,12 +39,7 @@ export default tsEslint.config(
|
|
|
43
39
|
],
|
|
44
40
|
},
|
|
45
41
|
{
|
|
46
|
-
extends: [
|
|
47
|
-
eslint.configs.recommended,
|
|
48
|
-
importX.flatConfigs.recommended,
|
|
49
|
-
unicorn.configs['flat/recommended'],
|
|
50
|
-
...fixupConfigRules(flatCompat.extends('plugin:eslint-comments/recommended')),
|
|
51
|
-
],
|
|
42
|
+
extends: [eslint.configs.recommended, importX.flatConfigs.recommended, unicorn.configs['flat/recommended']],
|
|
52
43
|
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
53
44
|
languageOptions: {
|
|
54
45
|
ecmaVersion: 'latest',
|
|
@@ -63,6 +54,7 @@ export default tsEslint.config(
|
|
|
63
54
|
},
|
|
64
55
|
plugins: {
|
|
65
56
|
'@stylistic': stylistic,
|
|
57
|
+
'eslint-comments': fixupPluginRules(eslintComments),
|
|
66
58
|
'prefer-arrow': fixupPluginRules(preferArrow),
|
|
67
59
|
'sort-class-members': fixupPluginRules(sortClassMembers),
|
|
68
60
|
'sort-destructure-keys': fixupPluginRules(sortDestructureKeys),
|
|
@@ -106,7 +98,10 @@ export default tsEslint.config(
|
|
|
106
98
|
{ blankLine: 'always', next: 'default', prev: '*' },
|
|
107
99
|
{ blankLine: 'always', next: '*', prev: 'break' },
|
|
108
100
|
],
|
|
109
|
-
'eslint-comments/
|
|
101
|
+
'eslint-comments/no-aggregating-enable': 2,
|
|
102
|
+
'eslint-comments/no-duplicate-disable': 2,
|
|
103
|
+
'eslint-comments/no-unlimited-disable': 2,
|
|
104
|
+
'eslint-comments/no-unused-enable': 2,
|
|
110
105
|
'import-x/extensions': [2, 'ignorePackages'],
|
|
111
106
|
'import-x/namespace': 0,
|
|
112
107
|
// This rule doesn't work on typescript files currently.
|
|
@@ -242,6 +237,7 @@ export default tsEslint.config(
|
|
|
242
237
|
prefer: 'type-imports',
|
|
243
238
|
},
|
|
244
239
|
],
|
|
240
|
+
'@typescript-eslint/explicit-function-return-type': 2,
|
|
245
241
|
'@typescript-eslint/naming-convention': [
|
|
246
242
|
2,
|
|
247
243
|
{
|
|
@@ -318,6 +314,7 @@ export default tsEslint.config(
|
|
|
318
314
|
2,
|
|
319
315
|
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' },
|
|
320
316
|
],
|
|
317
|
+
'@typescript-eslint/explicit-function-return-type': 0,
|
|
321
318
|
'@typescript-eslint/no-non-null-assertion': 0,
|
|
322
319
|
},
|
|
323
320
|
},
|