The ESLint rule for indent allows for you to specify which nodes are ignored, when determining whether the rule should apply to that node, using the ignoredNodes
option.
I've got the following code that I want to ignore with this rule:
const a = b
? `c${
d
}`
: e
Specifically, the line with d
and the subsequent line are reported as having two more spaces than they should. I want to ignore those lines from the rule, but I can't figure out the node that should apply.
Node types are specified in this repo. I know that ternary expressions, like used in this code, is a ConditionalExpression
node, and it seems like a template literal node exists, but I can't get it to work.
I know I can use eslint-disable-next-line
, eslint-disable
, etc., but I don't want to use those, because then I'd have to use them every time this comes up.