I've got a class definition that is too long for a single line. Prettier tries to wrap it but when it does it adds an indentation, which I think is correct. But ESLint doesn't like this so it throws an indent
error.
There seems to be no config in ESLint to change this behaviour.
Prettier output:
// ESLint throws an error
export default class FormFieldTemplateCheckboxList
implements ClassComponent<FormFieldTemplateCheckboxListProps> {}
ESLint output:
// Prettier formats to the above on save
export default class FormFieldTemplateCheckboxList
implements ClassComponent<FormFieldTemplateCheckboxListProps> {}
It's a loop of ESLint and Prettier clashing with what they think is correct.
Partial Fix
This fix requires the eslint-config-prettier
plugin, and removing indent
from the eslint rules.
My old .eslintrc.json
included the following;
"rules": {
"indent": ["error", "tab", { "SwitchCase": 1 }]
}
Now prettier controls the indentation. Now there is no error being thrown, which is what I want to occur.