Allow debugger; statements in certain files, using ESLint

user7898461 picture user7898461 · Nov 21, 2017 · Viewed 17k times · Source

Say I want to use this rule:

https://eslint.org/docs/rules/no-debugger

however, I have about 15 files where I want to keep debugger; statements.

Is there something I can add at the top of the .ts/.js files, that can tell ESLint to ignore the no-debugger rule for this particular file?

Answer

Andrzej Gis picture Andrzej Gis · Sep 21, 2020

You can also disable ESLint in the same line:

debugger; // eslint-disable-line no-debugger