It requires:
eslint-config-prettier
to avoid collision with other eslint ruleseslint-plugin-prettier
to add the eslint rulesprettier
package
yarn add --dev eslint-config-prettier eslint-plugin-prettier prettier
Add prettier
to eslint configuration plugins
section
Add prettier
last to eslint configuration extends
section
Add the prettier/prettier
rule:
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}