0
votes

Is there an eslint rule that can throw an if you disable a rule that is not triggering an error in the line/file.

For instance, using /* eslint-disable no-console */ would throw an error if used in a file that is not using console.

Does such rule exist already? I'm heavily using eslint in a React project and there seems that there could be many practical uses for such a rule.

1

1 Answers

1
votes

There's no rule to do so on the base eslint rules.

You could create one for yourself or add a plugin that adds this functionality, like:

eslint-plugin-eslint-comments

Rule: https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/no-unused-disable.md