Skip to content

Commit

Permalink
feat(eslint-config): remove base eslint formatting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Killusions committed Jan 24, 2025
1 parent 6aaa586 commit 2cf0400
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
24 changes: 10 additions & 14 deletions eslint-config-angular/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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 }]
}
});
Expand All @@ -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',
{
Expand All @@ -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'],
Expand Down Expand Up @@ -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'],
Expand All @@ -176,6 +171,7 @@ export const configRecommended = typescriptEslint.config({
}
],
'@typescript-eslint/prefer-optional-chain': ['error'],

'prefer-arrow/prefer-arrow-functions': ['error']
}
});
Expand Down
24 changes: 10 additions & 14 deletions eslint-config-typescript/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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 }]
}
});
Expand All @@ -88,6 +81,8 @@ export const configRecommended = typescriptEslint.config({
}
},
rules: {
'sort-imports': ['off'],

'perfectionist/sort-imports': [
'error',
{
Expand All @@ -100,6 +95,7 @@ export const configRecommended = typescriptEslint.config({
]
}
],

'@typescript-eslint/naming-convention': [
'error',
{
Expand Down Expand Up @@ -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'],
Expand All @@ -160,6 +155,7 @@ export const configRecommended = typescriptEslint.config({
}
],
'@typescript-eslint/prefer-optional-chain': ['error'],

'prefer-arrow/prefer-arrow-functions': ['error']
}
});
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2cf0400

Please sign in to comment.