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

fix(linter): move eslint-config-prettier to the end for proper override #28503

Merged
merged 9 commits into from
Nov 19, 2024
7 changes: 5 additions & 2 deletions packages/eslint-plugin/src/flat-configs/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default tseslint.config(
files: ['**/*.js', '**/*.jsx'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
},
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
{
languageOptions: {
parser: tseslint.parser,
Expand Down Expand Up @@ -80,5 +79,9 @@ export default tseslint.config(
*/
'@typescript-eslint/no-require-imports': 'off',
},
}
},
/**
* We include it last so it overrides the conflicting rules from the configuration blocks above.
*/
...(isPrettierAvailable ? [require('eslint-config-prettier')] : [])
);
7 changes: 5 additions & 2 deletions packages/eslint-plugin/src/flat-configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default tseslint.config(
files: ['**/*.ts', '**/*.tsx'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
},
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
{
plugins: { '@typescript-eslint': tseslint.plugin },
languageOptions: {
Expand Down Expand Up @@ -64,5 +63,9 @@ export default tseslint.config(
*/
'@typescript-eslint/no-require-imports': 'off',
},
}
},
/**
* We include it last so it overrides the conflicting rules from the configuration blocks above.
*/
...(isPrettierAvailable ? [require('eslint-config-prettier')] : [])
);