Uh oh!
There was an error while loading. Please reload this page.
tools: enable no-extra-semi rule in eslint - #2205
Conversation
silverwind
commented
Jul 19, 2015
Oh damn, looks like we were working on this at the same time (#2207). |
silverwind
commented
Jul 19, 2015
Regarding Regarding bodyless loops: I see you wenn with a |
silverwind
commented
Jul 19, 2015
Closed #2207 in favor of this. Maybe you can take a hint from the few changes I did differently. |
cjihrig
commented
Jul 19, 2015
|
silverwind
commented
Jul 19, 2015
ESLint already fixed the issue with the bodyless loops in eslint/eslint@25f14ae, which will eliminate 7 changes in this diff. I'd say let's wait until the ESLint 1.0 is out, which shouldn't be too far off, and then revisit this PR. |
targos
commented
Jul 19, 2015
OK then let's wait for v1.0. Good job on making them fix this issue so fast ! |
There was a problem hiding this comment.
This style shouldn't actually be enforced. You can do useful things inside while(); and for(;;); statements.
There was a problem hiding this comment.
That's what the mentioned ESlint bugfix is about: bodyless loops :)
Fishrock123
commented
Jul 20, 2015
@targos@joaocgreis@thefourtheye I forgot to mention in the onboarding session: We try to avoid purely style changes as much as possible. This is mostly because it makes Some concessions can be made for bringing the style to be more cohesive though. |
There was a problem hiding this comment.
might as well remove it completely ;)
targos
commented
Jul 24, 2015
I started to work on the eslint update on my fork, using the latest rc2. |
yosuke-furukawa
commented
Jul 24, 2015
No rule settings to avoid the errors?? If so, we need to suggest the settings to eslint |
Fishrock123
commented
Jul 24, 2015
@targos could you either report that to them, or pull one of the maintainers in here? Thanks. :) |
targos
commented
Jul 24, 2015
@Fishrock123 will do |
cjihrig
commented
Jul 24, 2015
This issue might be relevant - eslint/eslint#3139. Looks like it was fixed yesterday. |
targos
commented
Jul 25, 2015
Still present in rc-3. |
silverwind
commented
Jul 25, 2015
We could do varx;vary;varz;instead of varx,y,z;Its easier to handle because you don't have to think whether to put a comma or semicolon on each line, but I fear a 500+ line diff might be too much noise. Another argument against the second style is that the 4-character alignment doesn't work anymore with Any thoughts on this? |
Fishrock123
commented
Jul 25, 2015
That'd be so purely style changes that it wouldn't be approved. That's not even a lint fixing change really. Let's just wait until it gets fixed. |
silverwind
commented
Jul 27, 2015
Looks the error on 4-space alignment is intended and I think I have to agree that strictly speaking it's an violation of 2-space indent. We could either go with disabling the rule, doing my suggestion above, or do a ugly vara,b,c;I think we should consider my suggestion, even if the diff is huge. One {const,let,var} per variable is found in style guides like https://github.com/airbnb/javascript#13.2. |
targos
commented
Jul 27, 2015
I also don't want to change so many lines just to content the linter. |
targos
commented
Jul 27, 2015
I'm -1 for the ugly fix. |
Fishrock123
commented
Jul 27, 2015
I'm for var per line if we'd have to change the indentation to two spaces. I'm against doing either though, the diff would probably be huge... Is it unavoidable now? |
silverwind
commented
Jul 27, 2015
Looking through the 592 indent errors reported by rc-3, it looks like some of these are unrelated to the |
Fishrock123
commented
Jul 27, 2015
@silverwind any idea why they didn't catch them before? I'd really prefer to have an exception rule to this tbh. |
targos
commented
Jan 15, 2016
Done, although that's really a purely stylistic change. |
silverwind
commented
Jan 15, 2016
Of course it is, but we keep getting PRs for it ;) |
cjihrig
commented
Jan 15, 2016
The changes themselves LGTM. This is definitely churn though :-( |
silverwind
commented
Jan 16, 2016
LGTM. Yeah it's a bit of churn, but these are mostly on the closing bracket of functions, so shouldn't interfere with |
silverwind
commented
Jan 16, 2016
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
silverwind
commented
Jan 16, 2016
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Trott
commented
Feb 16, 2016
Should this go in LTS? (My feeling is it should.) |
rvagg
commented
Feb 16, 2016
fine by me, kill those extra semi's with fire, adding lts-watch |
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: #2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: nodejs#2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
PR-URL: nodejs#2205 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
This CL adds two rules:
no-extra-semi
semi-spacing (removed)
This one is up for discussion because the changes I had to make feel wrong to me.
For instance in
try {fs.rmdirSync(tmp(folder)); } catch (ex) {}the space isn't really improving readability. Maybe it would better if we added a space as well at the beginning of thetryblock, but I can't find a rule for that.Because of that I would prefer to explicitly disable this rule in
.eslintrcbut it is the one that enforces spaces in code likefor(let i = 0; i < x; i++)so we'd lose that check.