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
//eslint-disable-line
's behavior is changed in 4.7.0
#9318
Comments
//eslint-disable-line
's behavior changed in 4.7.0//eslint-disable-line
's behavior is changed in 4.7.0
In case it helps, here's a different repro for seemingly the same underlying issue: What did you do? Please include the actual source code causing the issue.
What did you expect to happen? no errors What actually happened? Please include the actual, raw output from ESLint.
|
I'm not sure about this -- the
This looks like a bug to me. |
@not-an-aardvark what about this case It worked fine in previous version but now i cannot disable no-use-before-define rule as you can see. However if you remove // eslint-disable-line in line 5 it works again. |
Hmm, that's a good point. I suppose we should treat // eslint-disable-next-line
foo;
bar;
// is processed the same as:
/* eslint-disable */foo;
/* eslint-enable */
bar; But it seems like that isn't accurate, because applying a global |
#9216 seemed to include a breaking change. |
Wow, did not know about this feature... lol |
@gyandeeps see the first post of this issue :D As @not-an-aardvark mentioned, |
Are people actually using the nesting aside from edit: The nesting behavior also had bugs like #9215. |
i agree with @not-an-aardvark .. those test (ref #9216 (comment)) are actually incorrect. Examples explained in that comment makes sense to me. |
I'm not using actually because |
just to be clear, the code mentioned in this issue above and also the 2nd comment code example are bugs.... but #9216 (comment) this is slightly different. |
In my perspective, those look /* eslint-disable no-unused-vars */
function aaa() {
/* eslint-disable */
var foo;
/* eslint-enable */
}
var bar;
/* eslint-enable no-unused-vars */ |
I think it makes the most sense for nesting to not be supported, and for Alternatively, we could update the implementation to support nesting again. (I don't think reverting would work well since we've made some additional changes to the code since the original refactor landed). However, this could end up being confusing, because the behavior in #9215 definitely seems incorrect to me. |
I agree that #9215 is a bug. Hmm, I suspect that it's a breaking change because the behavior exists in a long time. On the other hand, the behavior has been never documented, so semver doesn't consider that it's a breaking change. OK, I don't oppose the way no nesting. |
Just as a heads-up: I probably won't have time to fix this until Sunday night, so if someone else is able to fix it earlier, that might allow for more time to review before we do a patch release on Monday. |
As @mysticatea commented, our block-disabling comments stopped working in 4.7.0 as well. /* eslint-disable quotes */
console.log("foo");
/* eslint-enable quotes */ That now throws an error on |
A regression of eslint 4.7.0 was hit in index.js, eslint/eslint#9318. We simply keep older version 4.6.1. Once above eslint bug get resolved, we can retry and decide whether to update to latest version of eslint.
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
No errors as same as
4.6.0
.What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: