From 2cf0400f898241b67528873d5f7870b25f6648b6 Mon Sep 17 00:00:00 2001 From: Linus Schlumberger Date: Fri, 24 Jan 2025 13:31:45 +0000 Subject: [PATCH] feat(eslint-config): remove base eslint formatting rules --- eslint-config-angular/index.mjs | 24 ++++++++++-------------- eslint-config-typescript/index.mjs | 24 ++++++++++-------------- eslint.config.js | 2 +- package-lock.json | 2 +- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/eslint-config-angular/index.mjs b/eslint-config-angular/index.mjs index 9691c9e..6aaddbc 100644 --- a/eslint-config-angular/index.mjs +++ b/eslint-config-angular/index.mjs @@ -48,6 +48,10 @@ export const configBase = typescriptEslint.config({ 'space-infix-ops': ['off'], 'space-before-blocks': ['off'], + // Disable the recommended formatting rules. + 'no-unexpected-multiline': ['off'], + 'curly': ['off'], + '@typescript-eslint/array-type': ['error'], '@typescript-eslint/member-ordering': ['off'], '@typescript-eslint/naming-convention': ['off'], @@ -70,22 +74,11 @@ export const configBase = typescriptEslint.config({ '@typescript-eslint/prefer-function-type': ['error'], '@typescript-eslint/unified-signatures': ['error'], - 'array-bracket-spacing': ['error'], - 'arrow-parens': ['error', 'as-needed'], - 'arrow-spacing': ['error'], - 'block-spacing': ['error'], - 'curly': ['error'], - 'jsdoc/newline-after-description': ['off'], - 'key-spacing': ['error'], + 'prefer-arrow/prefer-arrow-functions': ['off'], + 'no-duplicate-imports': ['error'], 'no-empty': ['error'], 'no-irregular-whitespace': ['error'], - 'no-multi-spaces': ['error'], - 'no-multiple-empty-lines': ['error'], - 'prefer-arrow/prefer-arrow-functions': ['off'], - 'semi-spacing': ['error'], - 'space-in-parens': ['error'], - 'space-unary-ops': ['error'], 'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: true }] } }); @@ -98,6 +91,8 @@ export const configRecommended = typescriptEslint.config({ 'no-implied-eval': ['off'], 'no-loop-func': ['off'], 'no-useless-constructor': ['off'], + 'sort-imports': ['off'], + 'perfectionist/sort-imports': [ 'error', { @@ -110,6 +105,7 @@ export const configRecommended = typescriptEslint.config({ ] } ], + '@angular-eslint/component-max-inline-declarations': ['off'], '@angular-eslint/prefer-on-push-component-change-detection': ['off'], '@angular-eslint/use-component-selector': ['off'], @@ -160,7 +156,6 @@ export const configRecommended = typescriptEslint.config({ format: null } ], - '@typescript-eslint/no-for-in-array': ['error'], '@typescript-eslint/no-implied-eval': ['error'], '@typescript-eslint/no-loop-func': ['error'], @@ -176,6 +171,7 @@ export const configRecommended = typescriptEslint.config({ } ], '@typescript-eslint/prefer-optional-chain': ['error'], + 'prefer-arrow/prefer-arrow-functions': ['error'] } }); diff --git a/eslint-config-typescript/index.mjs b/eslint-config-typescript/index.mjs index 705cd3e..a58bd8d 100644 --- a/eslint-config-typescript/index.mjs +++ b/eslint-config-typescript/index.mjs @@ -38,6 +38,10 @@ export const configBase = typescriptEslint.config({ 'space-infix-ops': ['off'], 'space-before-blocks': ['off'], + // Disable the recommended formatting rules. + 'no-unexpected-multiline': ['off'], + 'curly': ['off'], + '@typescript-eslint/array-type': ['error'], '@typescript-eslint/member-ordering': ['off'], '@typescript-eslint/naming-convention': ['off'], @@ -60,22 +64,11 @@ export const configBase = typescriptEslint.config({ '@typescript-eslint/prefer-function-type': ['error'], '@typescript-eslint/unified-signatures': ['error'], - 'array-bracket-spacing': ['error'], - 'arrow-parens': ['error', 'as-needed'], - 'arrow-spacing': ['error'], - 'block-spacing': ['error'], - 'curly': ['error'], - 'jsdoc/newline-after-description': ['off'], - 'key-spacing': ['error'], + 'prefer-arrow/prefer-arrow-functions': ['off'], + 'no-duplicate-imports': ['error'], 'no-empty': ['error'], 'no-irregular-whitespace': ['error'], - 'no-multi-spaces': ['error'], - 'no-multiple-empty-lines': ['error'], - 'prefer-arrow/prefer-arrow-functions': ['off'], - 'semi-spacing': ['error'], - 'space-in-parens': ['error'], - 'space-unary-ops': ['error'], 'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: true }] } }); @@ -88,6 +81,8 @@ export const configRecommended = typescriptEslint.config({ } }, rules: { + 'sort-imports': ['off'], + 'perfectionist/sort-imports': [ 'error', { @@ -100,6 +95,7 @@ export const configRecommended = typescriptEslint.config({ ] } ], + '@typescript-eslint/naming-convention': [ 'error', { @@ -144,7 +140,6 @@ export const configRecommended = typescriptEslint.config({ format: null } ], - '@typescript-eslint/no-for-in-array': ['error'], '@typescript-eslint/no-implied-eval': ['error'], '@typescript-eslint/no-loop-func': ['error'], @@ -160,6 +155,7 @@ export const configRecommended = typescriptEslint.config({ } ], '@typescript-eslint/prefer-optional-chain': ['error'], + 'prefer-arrow/prefer-arrow-functions': ['error'] } }); diff --git a/eslint.config.js b/eslint.config.js index e4875d1..76c19fe 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,7 +15,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); export default [ - { ignores: ['dist'] }, + { ignores: ['dist', 'eslint-plugin-defaultvalue/lib/rules/**/*.js'] }, eslintJs.configs.recommended, { plugins: { 'headers': eslintPluginHeaders }, diff --git a/package-lock.json b/package-lock.json index 9d061d1..5a0be29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7428,7 +7428,7 @@ } }, "node_modules/npm/node_modules/chalk": { - "version": "5.3.0", + "version": "5.4.1", "dev": true, "inBundle": true, "license": "MIT",