I often use ESLint comments to ignore some special cases and work around ESLint bugs / missing features. Sometimes the latter gets fixed, but I still have those ESLint comments littered in my source files. Would be useful to be able to identify such comments and error about them. Same with /* globals */ entries that are no longer needed.
I haven't really thought through how this will work exactly or if it even makes sense here.
See:
// @jamestalmage @jfmengels
... how this will work exactly ...
One thing that would be fairly easy is to detect GitHub issues in the comments and check if they are closed or not. Below, a hypothetical GitHub issue is linked to as the reason for disabling a linting rule. A plugin could check its status and, if the issue is closed, the comment is considered moot.
// Disabled because of https://github.com/eslint/eslint/issues/123
// eslint-disable-next-line no-console
console.log();
This might not be quite as robust as linting the code with and without the disabled rule to compare, but it would be effective for most cases I run into in practice. PR URLs would be even better, as you can determine if they are open, merged, or closed without merging.
In the event that the issue is closed without being fixed, as is often the case with ESLint, you would either open a new issue elsewhere (such as here in XO) and update the comment, or remove the link from the comment, causing the plugin to ignore the disable comment.
@sholladay This has actually been added to ESLint: https://github.com/eslint/eslint/commit/3f2b908 But I couldn't get it to work.
Fixed: https://github.com/xojs/eslint-config-xo/commit/74e6aff2b11eafa76c07c6df1e0fb07f694637d3#diff-168726dbe96b3ce427e7fedce31bb0bcR15