Skip to content

Commit e0e4d0a

Browse files
committed
add new global ignores
1 parent 75bb1fd commit e0e4d0a

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/configs/base.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import js from '@eslint/js';
2+
import { globalIgnores } from 'eslint/config';
23
import eslintComments from 'eslint-plugin-eslint-comments';
34
import importPlugin from 'eslint-plugin-import';
45
import jsdoc from 'eslint-plugin-jsdoc';
@@ -11,6 +12,18 @@ import globals from 'globals';
1112
import type { Config } from '../types';
1213
import { createImportSortRule } from '../utils';
1314

15+
/**
16+
* List of common ESLint config file names to be globally ignored.
17+
*/
18+
const eslintConfigFileNames = [
19+
'eslint.config.js',
20+
'eslint.config.cjs',
21+
'eslint.config.mjs',
22+
'eslint.config.ts',
23+
'eslint.config.cts',
24+
'eslint.config.mts'
25+
];
26+
1427
/**
1528
* The base shared flat config for the plugin.
1629
* Extended by all other configs. Rules defined here should be applied to all projects.
@@ -22,6 +35,8 @@ export const baseConfig: Config = [
2235
pluginPromise.configs['flat/recommended'],
2336
importPlugin.flatConfigs.recommended,
2437
jsdoc.configs['flat/recommended'],
38+
globalIgnores([...eslintConfigFileNames], 'ESLint config files'),
39+
globalIgnores(['dist'], 'Ignore build output'),
2540
{
2641
name: 'bosh/base',
2742
plugins: {
@@ -57,12 +72,14 @@ export const baseConfig: Config = [
5772
'eslint-comments/require-description': 'error',
5873

5974
// JSDoc rules
60-
'jsdoc/require-jsdoc': 'off',
75+
'jsdoc/require-jsdoc': 'error',
6176

6277
// Import rules
63-
'import/no-unresolved': 'off', // Let TypeScript handle this
78+
// Let TypeScript handle this
79+
'import/no-unresolved': 'off',
6480

65-
// Simple import sort with default grouping. Can be overridden in project eslint.config.js
81+
// Simple import sort with default grouping.
82+
// Can be overridden in project eslint.config.js
6683
'simple-import-sort/exports': 'error',
6784
'simple-import-sort/imports': createImportSortRule(),
6885

@@ -73,7 +90,7 @@ export const baseConfig: Config = [
7390
'unicorn/prefer-query-selector': 'off',
7491
'unicorn/prevent-abbreviations': 'off',
7592

76-
// Custom rules
93+
// I just don't like it
7794
'no-unary-plus/no-unary-plus': 'error'
7895
}
7996
}

0 commit comments

Comments
 (0)