773 B
773 B
id | title |
---|---|
eslint | Integrating with ESLint |
If you are using ESLint, integrating Prettier to your workflow is straightforward:
Just add Prettier as an ESLint rule using eslint-plugin-prettier.
yarn add --dev prettier eslint-plugin-prettier
// .eslintrc.json
{
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "error"
}
}
We also recommend that you use eslint-config-prettier to disable all the existing formatting rules. It's a one liner that can be added on-top of any existing ESLint configuration.
$ yarn add --dev eslint-config-prettier
.eslintrc.json:
{
"extends": [
"prettier"
]
}