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
Allowing inline comments to disable eslint rules. #3471
Allowing inline comments to disable eslint rules. #3471
Conversation
So first you need to create an issue, explain the problem you have clearly, and then reference that issue from your commit :) |
c3f5e42
to
a403b80
Compare
@BYK issue created & referenced. |
@@ -28,8 +28,12 @@ module.exports = function(context) { | |||
// Also check after the comment | |||
var postamble = endLine.slice(node.loc.end.column).trim(); | |||
|
|||
// Check that this comment doesn't disable the line | |||
var disablesLine = startLine.indexOf("eslint-disable-line") >= 0 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has to be a bit more specific, otherwise the following would also be ignored:
// someday use eslint-disable-line here
What you really want is:
var isDirective = node.value.trim().indexOf("eslint-") === 0;
@wbyoung are you still working on this? |
I think this is a good way to go for now. |
a403b80
to
5ec4e88
Compare
@nzakas updated with your suggestion. Sorry for the delay. |
@wbyoung Can you update the commit message to have "Update" and not "New". |
5ec4e88
to
6179a9d
Compare
6179a9d
to
c1d91ea
Compare
@gyandeeps done. |
…-line Allowing inline comments to disable eslint rules.
Should the docs be updated to mention this? If so I can include in my current cleanup work. |
Good catch @IanVS . I think its good to add |
I'd like to be able to use inline comments to disable eslint rules, but to disallow any other type of inline comment.
This change allows that configuration.