eslint-config-prettier
Advanced tools
Changelog
Version 8.2.0 (2021-04-13)
Changelog
Version 8.1.0 (2021-02-24)
Changelog
Version 8.0.0 (2021-02-21)
Changed: All configs have been merged into one!
To upgrade, change:
{
"extends": [
"some-other-config-you-use",
"prettier",
"prettier/@typescript-eslint",
"prettier/babel",
"prettier/flowtype",
"prettier/react",
"prettier/standard",
"prettier/unicorn",
"prettier/vue"
]
}
Into:
<!-- prettier-ignore -->{
"extends": [
"some-other-config-you-use",
"prettier"
]
}
The "prettier"
config now includes not just ESLint core rules, but also rules from all plugins. Much simpler!
So … what’s the catch? Why haven’t we done this earlier? Turns out it’s just a sad mistake. I (@lydell) was confused when testing, and thought that turning off unknown rules in a config was an error. Thanks to Georgii Dolzhykov (@thorn0) for pointing this out!
If you use [eslint-plugin-prettier], all you need is [plugin:prettier/recommended]:
<!-- prettier-ignore -->{
"extends": [
"some-other-config-you-use",
"plugin:prettier/recommended"
]
}
(The ["prettier/prettier" config][prettier-prettier-config] still exists separately. It’s the odd one out. The main "prettier"
config does not include the rules from it.)
Changed: The CLI helper tool now only prints warnings for [arrow-body-style] and [prefer-arrow-callback], just like other “special rules.” This means that if you’ve decided to use those rules and [eslint-plugin-prettier] at the same time, you’ll get warnings but exit code zero (success).
Changelog
Version 7.2.0 (2021-01-18)
Changelog
Version 7.1.0 (2020-12-19)
Changelog
Version 7.0.0 (2020-12-05)
Changed: At least ESLint 7.0.0 is now required.
Changed: [arrow-body-style] and [prefer-arrow-callback] are no longer turned off by default. They only need to be turned off if you use [eslint-plugin-prettier]. If you do, add "prettier/prettier"
to your "extends"
array to turn them off again.
{
"extends": ["prettier", "prettier/prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
Alternatively, update [eslint-plugin-prettier] to version 3.2.0 or later which automatically turns off these two rules in its "plugin:prettier/recommended"
config.
The CLI helper tool only warns about these rules if you have the "prettier/prettier"
rule enabled for a file.
Changed: no-tabs
is now a validatable rule. If you use it, you should enable allowIndentationTabs
so that the rule works regardless of your Prettier config:
{
"rules": {
"no-tabs": ["error", { "allowIndentationTabs": true }]
}
}
Changed: The CLI helper tool is now called just eslint-config-prettier
instead of eslint-config-prettier-check
. This is so that npx eslint-config-prettier
always works regardless of whether you have already installed eslint-config-prettier
or not: If you have, the local installation is used; if you haven’t, npx
downloads a temporary copy.
Changed: The CLI helper tool no longer requires you to pipe the output of eslint --print-config
to it. Instead, it does that automatically for you via ESLint API:s added in ESLint v7.
Before:
npx eslint --print-config index.js | npx eslint-config-prettier-check
After:
npx eslint-config-prettier index.js
Improved: The npm package is now 75% smaller.
Changelog
Version 6.15.0 (2020-10-27)
Changelog
Version 6.14.0 (2020-10-21)
Changelog
Version 6.13.0 (2020-10-16)