-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: rule name prefixed with some characters works in deno-lint-ignore #287
Comments
@magurotuna that's correct. To be honest neither of these solutions is perfect and it should be probably handled by having "aliases" for rules, but I haven't yet figured how to do that. It was changed in #269. Feel free to revert to previous solution. |
@bartlomieju hmm... it's kind of more complex problem than I thought. :-| |
It's still hardcoded and won't work for rules with other plugins - but I guess we can not care ATM. So feel free to bring back previous behavior. |
Thank you for the explanation. Understood. |
@magurotuna I've been pondering on this issue for some time. I think we can solve it by using Ignoring of produced diagnostics would happen when processing each lint rule instead of doing it in bulk at the end. That should help us get rid of the hacky code you pointed in the first comment. |
@bartlomieju |
After some more pondering I think we shouldn't support aliases after all and require the proper rule names from |
@magurotuna what do you think? |
that makes sense to me. |
You can see that the rule name is wrong, prefixed with many
x
characters. We expect this directive not to have an effect.However, it does works, just as we write a directive correctly like
// deno-lint-ignore ban-types
.On the other hand, rule names suffixed with characters like
ban-typesxxxxxxxx
do not work, which is the behavior we expect.I read the code and then found the cause at:
deno_lint/src/linter.rs
Lines 103 to 108 in 14f1543
The comment says that using
ends_with
is to skip@typescript-eslint
prefix.This means we want
deno-lint
to be able to handle rule names prefixed with@typescript-eslint
, right?If so, we could probably realize it by removing
@typescript-eslint
prefix (if exists) when parsing a comment in the functionparse_ignore_comment
. In this way, I guess the bug I mentioned above will be fixed.The text was updated successfully, but these errors were encountered: