diff --git a/packages/eslint-plugin/src/flat-configs/javascript.ts b/packages/eslint-plugin/src/flat-configs/javascript.ts index 281a7e2402f63..aad10376c9603 100644 --- a/packages/eslint-plugin/src/flat-configs/javascript.ts +++ b/packages/eslint-plugin/src/flat-configs/javascript.ts @@ -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, @@ -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')] : []) ); diff --git a/packages/eslint-plugin/src/flat-configs/typescript.ts b/packages/eslint-plugin/src/flat-configs/typescript.ts index d32b685cdc529..58dc9e06b5c64 100644 --- a/packages/eslint-plugin/src/flat-configs/typescript.ts +++ b/packages/eslint-plugin/src/flat-configs/typescript.ts @@ -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: { @@ -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')] : []) );