2

I'm aware of the single-line syntax to disable an ESLint rule for the current or next line.

What I would like to know is if there is something similar to modify a rule for a specific line.

E.g.:

// eslint-modify-next-line yoda: ["error", "never", {"exceptRange": true}]
if (0 < count && count <= max) {
    // do something
}
Wilson F
  • 1,250
  • 1
  • 20
  • 37

1 Answers1

2

As far as I'm aware you can't modify the rules for a single line but you could modify the rules for that whole file using ESLint Configuration Comments

Matthew P
  • 717
  • 1
  • 7
  • 22