Skip to content

Add flat recommended config#616

Merged
BPScott merged 2 commits intomasterfrom
flat-config-2
Dec 19, 2023
Merged

Add flat recommended config#616
BPScott merged 2 commits intomasterfrom
flat-config-2

Conversation

@BPScott
Copy link
Copy Markdown
Member

@BPScott BPScott commented Dec 3, 2023

Fixes #591.
Fixes #592.
Original ideas extracted from #592.

Add flat recommended config file. Unlike the legacy recommended file this only enables the prettier rule and disables arrow-body-style and arrow-body-style. It does not enable anything from eslint-config-prettier.

It is now the responsibility of the consumer to enable both eslint-plugin-prettier and eslint-config-prettier. Configs extending other configs is complicated and not transparent. We should trust the user to configure their configs directly. In a future major change we should remove eslint-config-prettier from the legacy config too, as over lap between the responsibilities of eslint-plugin-prettier and eslint-config-prettier have always been a bit confusing and "a plugin goes and enables configs from other plugins" feels a bit odd. I think it is simpler if we push consumers towards "you configure both eslint-plugin-prettier and eslint-config-prettier in your repo's linting config.

Use it like this:

// eslint.config.js
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const eslintConfigPrettier = require('eslint-config-prettier');

return [
  eslintPluginPrettierRecommended,
  eslintConfigPrettier,
]

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ESLint flat config

2 participants