@repodog/eslint-config 9.0.4 → 9.0.6

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.
Files changed (2) hide show
  1. package/index.mjs +29 -4
  2. package/package.json +2 -1
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: [eslint.configs.recommended, importX.flatConfigs.recommended, unicorn.configs['flat/recommended']],
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,
@@ -111,7 +122,6 @@ export default tsEslint.config(
111
122
  '**/__mocks__/**',
112
123
  '**/.storybook/**',
113
124
  ],
114
- peerDependencies: false,
115
125
  },
116
126
  ],
117
127
  'import-x/order': [
@@ -124,6 +134,7 @@ export default tsEslint.config(
124
134
  ],
125
135
  'no-unused-vars': [2, { args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: false, vars: 'all' }],
126
136
  'no-use-before-define': [2, { functions: false }],
137
+ 'object-shorthand': [2, 'always', { avoidQuotes: true }],
127
138
  'one-var': [2, { initialized: 'never' }],
128
139
  'prefer-arrow/prefer-arrow-functions': [
129
140
  2,
@@ -215,6 +226,7 @@ export default tsEslint.config(
215
226
  'typescript-sort-keys': fixupPluginRules(typescriptSortKeys),
216
227
  },
217
228
  rules: {
229
+ '@typescript-eslint/consistent-type-assertions': [2, { assertionStyle: 'never' }],
218
230
  '@typescript-eslint/consistent-type-definitions': 0,
219
231
  '@typescript-eslint/consistent-type-imports': [
220
232
  2,
@@ -256,7 +268,7 @@ export default tsEslint.config(
256
268
  selector: 'typeLike',
257
269
  },
258
270
  ],
259
- '@typescript-eslint/no-non-null-assertion': 0,
271
+ '@typescript-eslint/no-non-null-assertion': 2,
260
272
  '@typescript-eslint/no-shadow': 2,
261
273
  '@typescript-eslint/no-unnecessary-type-parameters': 0,
262
274
  '@typescript-eslint/no-unused-vars': [
@@ -290,4 +302,17 @@ export default tsEslint.config(
290
302
  extends: [prettierRecommended],
291
303
  files: ['**/*.{mjs,cjs,js,jsx,ts,tsx}'],
292
304
  },
305
+ {
306
+ files: ['**/*.{spec,test}.*', '**/__testUtils__/**'],
307
+ plugins: {
308
+ '@typescript-eslint': tsEslint.plugin,
309
+ },
310
+ rules: {
311
+ '@typescript-eslint/consistent-type-assertions': [
312
+ 2,
313
+ { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' },
314
+ ],
315
+ '@typescript-eslint/no-non-null-assertion': 0,
316
+ },
317
+ },
293
318
  );
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",
4
+ "version": "9.0.6",
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",