Eslint(airbnb config) wants to have my params on new lines when I have multiple params. But when I do that, vscode formatting keeps giving 4 spaces indentation instead of 2 as expected.
Result:
const Example = ({
param1,
param2,
param3,
}) => (
<div>
{param1} {param2} {param3}
</div>
);
expected:
const Example = ({
param1,
param2,
param3,
}) => (
<div>
{param1} {param2} {param3}
</div>
);
Is there a setting I can use in vscode to get the expected behavior?
You can avoid conflicting rules by using eslint-config-prettier or preferably prettier-eslint integration. This integration will use eslint config for formatting the rules and there won't be any conflicts.
If you are using VS Code, there is a config option for prettier-vscode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With