How can I get ESLint indent
to like this code:
const a = `
<li
style=${styleMap({
color: '#F00', // bad line
background: '#0F0' // bad line
})} // bad line
>Something</li>
`;
It doesn't like the indenting on the lines I marked bad line
. This is what it wants me to do:
const a = `
<li
style=${styleMap({
color: '#F00',
background: '#0F0'
})}
>
<span>Something</span>
</li>
`;
which looks ridiculous.
Here is my current rule regarding 'indent':
indent: ['error', 2, { SwitchCase: 1 }],
I looked through the indent documentation but didn't see anything that seemed to match this scenario.
Edit: I went through all of the options for the indent
rule, set them all to 0
then went through one-by-one setting them to 10
to see which one affects my expression. Looks like ObjectExpression
is the culprit, but that value is normally good.
It seems like there are some issue dealing with template literal multiple line placeholder object declarations. I think my only recourse is going to be to add it to ignoreNodes
.