New version of estlint, running it on our code makes it fail.
Before patch
$ eslint .
core/misc/ajax.js
103:14 error Empty block statement no-empty
111:14 error Empty block statement no-empty
✖ 2 problems (2 errors, 0 warnings)
After patch, no errors.
New rule
Introduction of the new rule "one-var": [2, "never"],
This will enforce our coding standards. Our standards are a bit fuzzy and I've found several violations in core code. For that reason I'm making the standards tighter so that we can enforce them with eslint. Once this patch is RTBC I'll be editing the documentaion page. Currently we allow declaring several variables on one line if there is no assignment: var i, j, tmpStuff; this is now forbidden and will need to be written on 3 separate lines. Any good minifier will concatenate all that so there is no perf impact when minified.
Increment consistency
Not tied to ESlint but I changed the 4 increments using this style i += 1 to i++ in for loops for consistency (the new rule made it so the loops in question had to be modified anyway).
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | eslint_0_18_0-2461531-19.patch | 38.32 KB | lauriii |
| #16 | interdiff.txt | 195 bytes | nod_ |
| #16 | core-js-eslint-rules-0.18.0-2461531-16.patch | 38.31 KB | nod_ |
Comments
Comment #5
nod_RTBC because eslint did the review by itself :-°
This can prevent things like #1751436-20: Selectors clean-up: bartik/color theme.
Comment #6
webchickWould still be good to get another (human) review.
Comment #7
nod_Reroll because of the
is-activeclass name change.Comment #9
nod_well, yeah.
Comment #10
pguillard commentedAfter careful reading (with my eyes!), I did not detect anything.
+1 for RTBC
Comment #11
pguillard commentedComment #15
nod_Comment #16
nod_the sourcemap issues added some test javascript that need to be excluded from eslint scan. Added a line in eslintingnore.
Comment #17
lauriiiRTBC+1, fixes the eslint errors
Comment #18
alexpottAlso we have some new eslint fails...
Comment #19
lauriiiI can't reproduce the eslint warnings after the patch.
Comment #20
alexpott@lauriii yep this fixes #18
Comment #21
nod_Reroll needed because of translation ui.
Applies and work.
Comment #22
alexpottCommitted 49a1b84 and pushed to 8.0.x. Thanks!