Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra: name eslint config groups for inspection #3249

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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