@repodog/eslint-config 9.0.3 → 9.0.5
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/README.md +1 -1
- package/index.mjs +30 -3
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install @repodog/eslint-config eslint prettier typescript --save-dev
|
|
|
19
19
|
import config from '@repodog/eslint-config';
|
|
20
20
|
|
|
21
21
|
// eslint convention is to export default
|
|
22
|
-
// eslint-disable-next-line import/no-default-export
|
|
22
|
+
// eslint-disable-next-line import-x/no-default-export
|
|
23
23
|
export default [
|
|
24
24
|
...config,
|
|
25
25
|
];
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
1
|
+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
2
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
3
|
import eslint from '@eslint/js';
|
|
3
4
|
import stylistic from '@stylistic/eslint-plugin';
|
|
4
5
|
import importX from 'eslint-plugin-import-x';
|
|
@@ -17,6 +18,10 @@ import tsEslint from 'typescript-eslint';
|
|
|
17
18
|
const cwd = process.cwd();
|
|
18
19
|
const project = './tsconfig.json';
|
|
19
20
|
|
|
21
|
+
const flatCompat = new FlatCompat({
|
|
22
|
+
baseDirectory: cwd,
|
|
23
|
+
});
|
|
24
|
+
|
|
20
25
|
// eslint convention is to export default
|
|
21
26
|
// eslint-disable-next-line import-x/no-default-export
|
|
22
27
|
export default tsEslint.config(
|
|
@@ -36,7 +41,12 @@ export default tsEslint.config(
|
|
|
36
41
|
],
|
|
37
42
|
},
|
|
38
43
|
{
|
|
39
|
-
extends: [
|
|
44
|
+
extends: [
|
|
45
|
+
eslint.configs.recommended,
|
|
46
|
+
importX.flatConfigs.recommended,
|
|
47
|
+
unicorn.configs['flat/recommended'],
|
|
48
|
+
...fixupConfigRules(flatCompat.extends('plugin:eslint-comments/recommended')),
|
|
49
|
+
],
|
|
40
50
|
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
41
51
|
languageOptions: {
|
|
42
52
|
ecmaVersion: 'latest',
|
|
@@ -94,6 +104,7 @@ export default tsEslint.config(
|
|
|
94
104
|
{ blankLine: 'always', next: 'default', prev: '*' },
|
|
95
105
|
{ blankLine: 'always', next: '*', prev: 'break' },
|
|
96
106
|
],
|
|
107
|
+
'eslint-comments/disable-enable-pair': 0,
|
|
97
108
|
'import-x/extensions': [2, 'ignorePackages'],
|
|
98
109
|
'import-x/namespace': 0,
|
|
99
110
|
'import-x/no-default-export': 2,
|
|
@@ -124,6 +135,7 @@ export default tsEslint.config(
|
|
|
124
135
|
],
|
|
125
136
|
'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' }],
|
|
126
137
|
'no-use-before-define': [2, { functions: false }],
|
|
138
|
+
'object-shorthand': [2, 'always', { avoidQuotes: true }],
|
|
127
139
|
'one-var': [2, { initialized: 'never' }],
|
|
128
140
|
'prefer-arrow/prefer-arrow-functions': [
|
|
129
141
|
2,
|
|
@@ -215,6 +227,7 @@ export default tsEslint.config(
|
|
|
215
227
|
'typescript-sort-keys': fixupPluginRules(typescriptSortKeys),
|
|
216
228
|
},
|
|
217
229
|
rules: {
|
|
230
|
+
'@typescript-eslint/consistent-type-assertions': [2, { assertionStyle: 'never' }],
|
|
218
231
|
'@typescript-eslint/consistent-type-definitions': 0,
|
|
219
232
|
'@typescript-eslint/consistent-type-imports': [
|
|
220
233
|
2,
|
|
@@ -256,7 +269,7 @@ export default tsEslint.config(
|
|
|
256
269
|
selector: 'typeLike',
|
|
257
270
|
},
|
|
258
271
|
],
|
|
259
|
-
'@typescript-eslint/no-non-null-assertion':
|
|
272
|
+
'@typescript-eslint/no-non-null-assertion': 2,
|
|
260
273
|
'@typescript-eslint/no-shadow': 2,
|
|
261
274
|
'@typescript-eslint/no-unnecessary-type-parameters': 0,
|
|
262
275
|
'@typescript-eslint/no-unused-vars': [
|
|
@@ -290,4 +303,18 @@ export default tsEslint.config(
|
|
|
290
303
|
extends: [prettierRecommended],
|
|
291
304
|
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
292
305
|
},
|
|
306
|
+
{
|
|
307
|
+
extends: [prettierRecommended],
|
|
308
|
+
files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
files: ['**/*.{spec,test}.*', '**/__testUtils__/**'],
|
|
312
|
+
rules: {
|
|
313
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
314
|
+
2,
|
|
315
|
+
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' },
|
|
316
|
+
],
|
|
317
|
+
'@typescript-eslint/no-non-null-assertion': 0,
|
|
318
|
+
},
|
|
319
|
+
},
|
|
293
320
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repodog/eslint-config",
|
|
3
3
|
"description": "The Repodog ESLint config module.",
|
|
4
|
-
"version": "9.0.
|
|
4
|
+
"version": "9.0.5",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/repodog",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
29
29
|
"eslint-config-prettier": "^9.1.0",
|
|
30
30
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
31
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
31
32
|
"eslint-plugin-import-x": "^4.2.1",
|
|
32
33
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
33
34
|
"eslint-plugin-prettier": "^5.2.1",
|