| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Oh damn, looks like we were working on this at the same time (#2207). |
Sorry, something went wrong.
|
Regarding semi-spacing: I use it personally in my projects, but didn't see the necessity because the extra space looks "wrong" in a try {something; } to me. I see some value in the spacing of a for loop, maybe we should propose an option like forOnly to that rule. Regarding bodyless loops: I see you wenn with a {} as a simple workaround to the rule bug. It's one way of handling it, but I feel the refactoring I did in the two lib cases might help make them more readable. |
Sorry, something went wrong.
|
Closed #2207 in favor of this. Maybe you can take a hint from the few changes I did differently. |
Sorry, something went wrong.
|
try {something; } does look a little... not quite right. I'd say either turn it off or add a space at the beginning as well. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
OK then let's wait for v1.0. Good job on making them fix this issue so fast ! |
Sorry, something went wrong.
There was a problem hiding this comment.
This style shouldn't actually be enforced. You can do useful things inside while(); and for(;;); statements.
Sorry, something went wrong.
There was a problem hiding this comment.
That's what the mentioned ESlint bugfix is about: bodyless loops :)
Sorry, something went wrong.
There was a problem hiding this comment.
I reverted those changes
Sorry, something went wrong.
|
@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 git blame harder to understand. Some concessions can be made for bringing the style to be more cohesive though. |
Sorry, something went wrong.
There was a problem hiding this comment.
might as well remove it completely ;)
Sorry, something went wrong.
There was a problem hiding this comment.
all right
Sorry, something went wrong.
|
I started to work on the eslint update on my fork, using the latest rc2. |
Sorry, something went wrong.
|
No rule settings to avoid the errors?? If so, we need to suggest the settings to eslint |
Sorry, something went wrong.
|
@targos could you either report that to them, or pull one of the maintainers in here? Thanks. :) |
Sorry, something went wrong.
|
This issue might be relevant - eslint/eslint#3139. Looks like it was fixed yesterday. |
Sorry, something went wrong.
|
Still present in rc-3. |
Sorry, something went wrong.
|
We could do var x;
var y;
var z;instead of var x,
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 const as opposed to var. Any thoughts on this? |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
|
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 var a,
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. |
Sorry, something went wrong.
|
I also don't want to change so many lines just to content the linter. |
Sorry, something went wrong.
|
I'm -1 for the ugly fix. |
Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
|
Looking through the 592 indent errors reported by rc-3, it looks like some of these are unrelated to the var style and seem bugged (especially cases after an if condition). We might be able to reduce the number of changes to like 300-400 lines (note, this includes test), but that indentation style looks to be pretty common. |
Sorry, something went wrong.
|
@silverwind any idea why they didn't catch them before? I'd really prefer to have an exception rule to this tbh. |
Sorry, something went wrong.
|
Done, although that's really a purely stylistic change. |
Sorry, something went wrong.
|
Of course it is, but we keep getting PRs for it ;) |
Sorry, something went wrong.
|
The changes themselves LGTM. This is definitely churn though :-( |
Sorry, something went wrong.
|
LGTM. Yeah it's a bit of churn, but these are mostly on the closing bracket of functions, so shouldn't interfere with git blame that much. |
Sorry, something went wrong.
Sorry, something went wrong.
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>
Sorry, something went wrong.
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>
|
Should this go in LTS? (My feeling is it should.) |
Sorry, something went wrong.
|
fine by me, kill those extra semi's with fire, adding lts-watch |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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 the try block, but I can't find a rule for that.
Because of that I would prefer to explicitly disable this rule in .eslintrc but it is the one that enforces spaces in code like for(let i = 0; i < x; i++) so we'd lose that check.