eslintignore

Allow debugger; statements in certain files, using ESLint

可紊 提交于 2020-12-29 03:56:14
问题 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? 回答1: You can do that like this: /* eslint-disable no-debugger */ ... code that violates rule ... /* eslint-enable no-debugger */ 回答2: You can also disable ESLint in the same line: debugger; // eslint-disable-line