Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29374555: Issue 3692 - Add base ESLint configuration (Closed)

Created:
Feb. 3, 2017, 9:18 a.m. by kzar
Modified:
Feb. 17, 2017, 7:17 a.m.
CC:
juliandoucette, Felix Dahlke, Thomas Greiner
Visibility:
Public.

Description

Issue 3692 - Add base ESLint configuration This is a continuation of Julian's work, see the related codereview here https://codereview.adblockplus.org/29346539/ . To see what these rules may mean in practice have a look at the required changes to adblockpluschrome so far. https://github.com/kzar/adblockpluschrome/tree/4864-eslint (Note those changes haven't been tested yet and likely are a little rough.)

Patch Set 1 #

Total comments: 33

Patch Set 2 : Addressed Wladimir's feedback #

Patch Set 3 : Added browser env #

Total comments: 2

Patch Set 4 : Removed browser env again #

Patch Set 5 : Switch no-case-declarations off #

Patch Set 6 : Move configuration to a Node.js module in the codingtools repository #

Total comments: 8

Patch Set 7 : Addressed Sebastian's feedback #

Total comments: 7

Patch Set 8 : Addressed Sebastian's further feedback #

Total comments: 11

Patch Set 9 : Removed no-shadow rule #

Patch Set 10 : Allow empty catch blocks #

Total comments: 3

Patch Set 11 : Turn no-shadow back on #

Total comments: 14

Patch Set 12 : Addressed Wladimir's feedback #

Total comments: 5

Patch Set 13 : Addressed Sebastian's feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -0 lines) Patch
A eslint-config-eyeo/README.md View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +32 lines, -0 lines 0 comments Download
A eslint-config-eyeo/index.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +114 lines, -0 lines 0 comments Download
A eslint-config-eyeo/package.json View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 46
kzar
Patch Set 1
Feb. 3, 2017, 9:28 a.m. (2017-02-03 09:28:04 UTC) #1
kzar
On 2017/02/03 09:28:04, kzar wrote: > Patch Set 1 (Also note that ESLint will not ...
Feb. 3, 2017, 9:31 a.m. (2017-02-03 09:31:29 UTC) #2
Wladimir Palant
Sorry if I duplicated some of the previous discussion, I didn't read it all. https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json ...
Feb. 3, 2017, 10:24 a.m. (2017-02-03 10:24:13 UTC) #3
Sebastian Noack
> Also note that each project using ESLint will have it's own configuration > which ...
Feb. 3, 2017, 12:49 p.m. (2017-02-03 12:49:32 UTC) #4
Wladimir Palant
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/03 12:49:32, Sebastian Noack wrote: > ...
Feb. 3, 2017, 1:01 p.m. (2017-02-03 13:01:34 UTC) #5
kzar
Patch Set 2 : Addressed Wladimir's feedback https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode16 .eslintrc.json:16: "computed-property-spacing": "error", ...
Feb. 4, 2017, 3:18 a.m. (2017-02-04 03:18:55 UTC) #6
Wladimir Palant
LGTM
Feb. 4, 2017, 7:38 a.m. (2017-02-04 07:38:19 UTC) #7
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/04 03:18:55, kzar wrote: > On ...
Feb. 4, 2017, 4:43 p.m. (2017-02-04 16:43:38 UTC) #8
Wladimir Palant
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/04 16:43:37, Sebastian Noack wrote: > ...
Feb. 4, 2017, 9:13 p.m. (2017-02-04 21:13:13 UTC) #9
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/04 21:13:13, Wladimir Palant wrote: > ...
Feb. 5, 2017, 6:22 p.m. (2017-02-05 18:22:39 UTC) #10
kzar
Patch Set 3 : Added browser env https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode49 .eslintrc.json:49: "no-undef": "off", ...
Feb. 6, 2017, 6:21 a.m. (2017-02-06 06:21:01 UTC) #11
Wladimir Palant
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/05 18:22:39, Sebastian Noack wrote: > ...
Feb. 6, 2017, 9:55 a.m. (2017-02-06 09:55:20 UTC) #12
kzar
Patch Set 4 : Removed browser env again https://codereview.adblockplus.org/29374555/diff/29374619/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374619/.eslintrc.json#newcode5 .eslintrc.json:5: "browser": ...
Feb. 6, 2017, 10 a.m. (2017-02-06 10:00:27 UTC) #13
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/06 09:55:19, Wladimir Palant wrote: > ...
Feb. 6, 2017, 1:54 p.m. (2017-02-06 13:54:43 UTC) #14
kzar
Patch Set 5 : Switch no-case-declarations off https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", ...
Feb. 6, 2017, 4:26 p.m. (2017-02-06 16:26:13 UTC) #15
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode29 .eslintrc.json:29: "no-case-declarations": "off", On 2017/02/06 16:26:13, kzar wrote: > On ...
Feb. 6, 2017, 5:26 p.m. (2017-02-06 17:26:00 UTC) #16
kzar
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode49 .eslintrc.json:49: "no-undef": "off", On 2017/02/06 17:26:00, Sebastian Noack wrote: > ...
Feb. 7, 2017, 6:37 a.m. (2017-02-07 06:37:59 UTC) #17
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode49 .eslintrc.json:49: "no-undef": "off", On 2017/02/07 06:37:58, kzar wrote: > On ...
Feb. 7, 2017, 11:57 a.m. (2017-02-07 11:57:15 UTC) #18
kzar
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode49 .eslintrc.json:49: "no-undef": "off", On 2017/02/07 11:57:15, Sebastian Noack wrote: > ...
Feb. 7, 2017, 5:07 p.m. (2017-02-07 17:07:52 UTC) #19
kzar
https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json File .eslintrc.json (right): https://codereview.adblockplus.org/29374555/diff/29374556/.eslintrc.json#newcode49 .eslintrc.json:49: "no-undef": "off", On 2017/02/07 17:07:51, kzar wrote: > On ...
Feb. 9, 2017, 4:55 a.m. (2017-02-09 04:55:28 UTC) #20
Sebastian Noack
I wonder where we should put the ESLint configuration. It seems the initial idea was ...
Feb. 9, 2017, 11:30 a.m. (2017-02-09 11:30:56 UTC) #21
kzar
On 2017/02/09 11:30:56, Sebastian Noack wrote: > I wonder where we should put the ESLint ...
Feb. 9, 2017, 12:09 p.m. (2017-02-09 12:09:35 UTC) #22
Sebastian Noack
From the discussion on IRC, it seems we prefer to have the configuration in codingtools. ...
Feb. 9, 2017, 3:51 p.m. (2017-02-09 15:51:30 UTC) #23
kzar
Patch Set 6 : Move configuration to a Node.js module in the codingtools repository
Feb. 10, 2017, 2:54 p.m. (2017-02-10 14:54:03 UTC) #24
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/README.md File eslint-config-eyeo/README.md (right): https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/README.md#newcode4 eslint-config-eyeo/README.md:4: [Adblock Plus coding style guide](https://adblockplus.org/coding-style#javascript). This seems a little ...
Feb. 10, 2017, 6:04 p.m. (2017-02-10 18:04:32 UTC) #25
kzar
Patch Set 7 : Addressed Sebastian's feedback https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/README.md File eslint-config-eyeo/README.md (right): https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/README.md#newcode4 eslint-config-eyeo/README.md:4: [Adblock Plus ...
Feb. 10, 2017, 7:10 p.m. (2017-02-10 19:10:45 UTC) #26
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/index.js#newcode33 eslint-config-eyeo/index.js:33: camelcase: ["error", {properties: "never"}], IOn 2017/02/10 19:10:45, kzar wrote: ...
Feb. 12, 2017, 8:53 p.m. (2017-02-12 20:53:12 UTC) #27
kzar
Patch Set 8 : Addressed Sebastian's further feedback https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374927/eslint-config-eyeo/index.js#newcode33 eslint-config-eyeo/index.js:33: camelcase: ...
Feb. 13, 2017, 6:02 a.m. (2017-02-13 06:02:58 UTC) #28
kzar
Patch Set 9 : Removed no-shadow rule https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js#newcode68 eslint-config-eyeo/index.js:68: "no-shadow": "error", ...
Feb. 13, 2017, 8:37 a.m. (2017-02-13 08:37:26 UTC) #29
kzar
Patch Set 10 : Allow empty catch blocks https://codereview.adblockplus.org/29374555/diff/29375559/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29375559/eslint-config-eyeo/index.js#newcode56 eslint-config-eyeo/index.js:56: "no-empty": ...
Feb. 13, 2017, 9:27 a.m. (2017-02-13 09:27:09 UTC) #30
Felix Dahlke
Don't want to get involved too deeply here so I'm staying in CC, but there's ...
Feb. 13, 2017, 9:51 a.m. (2017-02-13 09:51:20 UTC) #31
kzar
https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js#newcode38 eslint-config-eyeo/index.js:38: "curly": ["error", "multi-or-nest", "consistent"], On 2017/02/13 09:51:20, Felix Dahlke ...
Feb. 13, 2017, 10:07 a.m. (2017-02-13 10:07:50 UTC) #32
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js#newcode61 eslint-config-eyeo/index.js:61: "no-labels": "error", On 2017/02/13 06:02:58, kzar wrote: > On ...
Feb. 13, 2017, 11:31 a.m. (2017-02-13 11:31:30 UTC) #33
Felix Dahlke
https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js#newcode38 eslint-config-eyeo/index.js:38: "curly": ["error", "multi-or-nest", "consistent"], On 2017/02/13 11:31:29, Sebastian Noack ...
Feb. 13, 2017, 12:05 p.m. (2017-02-13 12:05:16 UTC) #34
kzar
Patch Set 11 : Turn no-shadow back on https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js#newcode61 eslint-config-eyeo/index.js:61: "no-labels": ...
Feb. 13, 2017, 1:02 p.m. (2017-02-13 13:02:22 UTC) #35
Thomas Greiner
https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js#newcode38 eslint-config-eyeo/index.js:38: "curly": ["error", "multi-or-nest", "consistent"], > I don't have any ...
Feb. 13, 2017, 1:06 p.m. (2017-02-13 13:06:14 UTC) #36
kzar
On 2017/02/13 13:06:14, Thomas Greiner wrote: > I can only speak for myself but my ...
Feb. 13, 2017, 1:13 p.m. (2017-02-13 13:13:15 UTC) #37
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374931/eslint-config-eyeo/index.js#newcode61 eslint-config-eyeo/index.js:61: "no-labels": "error", On 2017/02/13 13:02:21, kzar wrote: > On ...
Feb. 13, 2017, 2:20 p.m. (2017-02-13 14:20:29 UTC) #38
Thomas Greiner
On 2017/02/13 13:13:15, kzar wrote: > But any opinion on inconsistent braces in an if...else... ...
Feb. 13, 2017, 4:06 p.m. (2017-02-13 16:06:11 UTC) #39
Felix Dahlke
https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29374944/eslint-config-eyeo/index.js#newcode38 eslint-config-eyeo/index.js:38: "curly": ["error", "multi-or-nest", "consistent"], On 2017/02/13 13:06:13, Thomas Greiner ...
Feb. 14, 2017, 10:26 a.m. (2017-02-14 10:26:15 UTC) #40
Wladimir Palant
https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/README.md File eslint-config-eyeo/README.md (right): https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/README.md#newcode11 eslint-config-eyeo/README.md:11: (As root, or using sudo.) Nit: I'm not a ...
Feb. 14, 2017, 12:43 p.m. (2017-02-14 12:43:21 UTC) #41
kzar
Patch Set 12 : Addressed Wladimir's feedback https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/README.md File eslint-config-eyeo/README.md (right): https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/README.md#newcode11 eslint-config-eyeo/README.md:11: (As root, ...
Feb. 15, 2017, 5:24 a.m. (2017-02-15 05:24:23 UTC) #42
Wladimir Palant
I didn't mean that you should remove allowEmptyCatch already but I don't mind either. LGTM
Feb. 15, 2017, 8:06 a.m. (2017-02-15 08:06:10 UTC) #43
Sebastian Noack
https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/index.js#newcode56 eslint-config-eyeo/index.js:56: "no-empty": ["error", {allowEmptyCatch: true}], On 2017/02/15 05:24:22, kzar wrote: ...
Feb. 15, 2017, 10:35 a.m. (2017-02-15 10:35:25 UTC) #44
kzar
Patch Set 13 : Addressed Sebastian's feedback https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/index.js File eslint-config-eyeo/index.js (right): https://codereview.adblockplus.org/29374555/diff/29375587/eslint-config-eyeo/index.js#newcode56 eslint-config-eyeo/index.js:56: "no-empty": ["error", ...
Feb. 15, 2017, 11:45 a.m. (2017-02-15 11:45:20 UTC) #45
Sebastian Noack
Feb. 15, 2017, 11:58 a.m. (2017-02-15 11:58:06 UTC) #46
LGTM

(But as I said before, I only agree to no-unref rule under the condition that we
significantly reduce the usage of global variables in adblockpluschrome, rather
than adding much boilerplate there)

https://codereview.adblockplus.org/29374555/diff/29375725/eslint-config-eyeo/...
File eslint-config-eyeo/index.js (right):

https://codereview.adblockplus.org/29374555/diff/29375725/eslint-config-eyeo/...
eslint-config-eyeo/index.js:53: "no-console": ["error", {allow: ["warn",
"error", "trace"]}],
On 2017/02/15 11:45:20, kzar wrote:
> On 2017/02/15 10:35:24, Sebastian Noack wrote:
> > We discussed that before, but I just noticed that you ignored my last
comment
> on
> > that debate in the other review. Do we have any legit use of console.warn()
> and
> > console.trace() in our code? In particular console.trace() seems to be
mostly
> > useful for debugging, with a similar chance as console.log() to be added
> > temporarily and then being forgotten.
> 
> console.trace is used here:
> https://github.com/adblockplus/adblockpluschrome/blob/master/lib/compat.js#L83
> 
> As for console.warn I don't see that in any of our code, but we should
probably
> use it in this code that currently uses console.log:
> https://github.com/adblockplus/adblockpluscore/blob/master/lib/rsa.js#L143

Acknowledged.

Powered by Google App Engine
This is Rietveld