Skip to content

Commit

Permalink
infra: name eslint config groups for inspection (#3249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Nov 5, 2024
1 parent ae10d9a commit df87d60
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
//#region global
includeIgnoreFile(gitignorePath),
{
name: 'manual ignores',
ignores: [
// Skip some files that don't need linting right now
'.github/workflows/commentCodeGeneration.ts',
Expand All @@ -29,6 +30,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
],
},
{
name: 'linter options',
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
Expand All @@ -38,6 +40,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
//#region eslint (js)
eslint.configs.recommended,
{
name: 'eslint overrides',
rules: {
eqeqeq: ['error', 'always', { null: 'ignore' }],
'logical-assignment-operators': 'error',
Expand All @@ -52,9 +55,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
//#region typescript-eslint
...tseslint.configs.strictTypeChecked,
{
plugins: {
'@typescript-eslint': tseslint.plugin,
},
name: 'typescript-eslint overrides',
languageOptions: {
parserOptions: {
project: true,
Expand Down Expand Up @@ -129,6 +130,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(

//#region stylistic
{
name: 'stylistic overrides',
plugins: {
'@stylistic': stylistic,
},
Expand All @@ -144,6 +146,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
//#region unicorn
eslintPluginUnicorn.configs['flat/recommended'],
{
name: 'unicorn overrides',
rules: {
'unicorn/import-style': 'off', // subjective & doesn't do anything for us
'unicorn/no-array-callback-reference': 'off', // reduces readability
Expand All @@ -169,6 +172,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
//#region jsdoc
eslintPluginJsdoc.configs['flat/recommended-typescript-error'],
{
name: 'jsdoc overrides',
rules: {
'jsdoc/require-jsdoc': 'off', // Enabled only for src/**/*.ts
'jsdoc/require-returns': 'off',
Expand Down Expand Up @@ -209,6 +213,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(

//#region overrides
{
name: 'src/**/*.ts overrides',
files: ['src/**/*.ts'],
rules: {
'no-undef': 'error', // Must override the config from typescript-eslint
Expand All @@ -220,12 +225,14 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
},
},
{
name: 'src/locale/**/*.ts overrides',
files: ['src/locale/**/*.ts'],
rules: {
'unicorn/filename-case': 'off', // our locale files have a custom naming scheme
},
},
{
name: 'src/{definitions,locales}/**/*.ts overrides',
files: ['src/definitions/**/*.ts', 'src/locales/**/*.ts'],
rules: {
'unicorn/filename-case': [
Expand All @@ -238,6 +245,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
},
},
{
name: 'test/**/*.ts overrides',
files: ['test/**/*.spec.ts', 'test/**/*.spec.d.ts'],
plugins: {
vitest: eslintPluginVitest,
Expand Down

0 comments on commit df87d60

Please sign in to comment.