Closed Bug 1436389 Opened 2 years ago Closed 2 years ago

Upgrade ESLint to the latest version (4.17.0)

Categories

(Firefox Build System :: Lint and Formatting, enhancement, P1)

3 Branch
enhancement

Tracking

(firefox60 fixed)

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: standard8, Assigned: standard8)

Details

Attachments

(4 files)

We should upgrade ESLint to the latest version. There's various fixes and improvements.

Of note:

- v4.15 added support for messageIds, this simplifies rules & tests https://eslint.org/blog/2018/01/eslint-v4.15.0-released
- There's improvements in complexity calculations, though unfortunately a lot of our complexity values have increased.

There's also a change for how eslint-env is evaluated which breaks our xbl files. Seeing as we're working on removing these, the easiest thing is to switch to glob-based config and specify it in the root .eslintrc.js for now.
Comment on attachment 8949130 [details]
Bug 1436389 - Upgrade ESLint to version 4.17.0.

https://reviewboard.mozilla.org/r/218528/#review224334
Attachment #8949130 - Flags: review?(dtownsend) → review+
Comment on attachment 8949131 [details]
Bug 1436389 - Switch xbl related files to a different method for determining their environment.

https://reviewboard.mozilla.org/r/218530/#review224336
Attachment #8949131 - Flags: review?(dtownsend) → review+
Comment on attachment 8949132 [details]
Bug 1436389 - Update complexity rules to adapt for the algorithm in the new ESLint.

https://reviewboard.mozilla.org/r/218532/#review224338

Is complexity something that it is really useful to lint? All these numbers just seem somewhat arbitrary and I don't know that we're gaining much from them.
Attachment #8949132 - Flags: review?(dtownsend) → review+
Comment on attachment 8949133 [details]
Bug 1436389 - Fix space-unary-ops issues picked up by the new version of ESLint.

https://reviewboard.mozilla.org/r/218534/#review224340
Attachment #8949133 - Flags: review?(dtownsend) → review+
(In reply to Dave Townsend [:mossop] from comment #7)
> Is complexity something that it is really useful to lint? All these numbers
> just seem somewhat arbitrary and I don't know that we're gaining much from
> them.

We might want to review this at some stage, I think we either need to be actively working to reduce the complexity of a lot of these function (and get people on board), or abandon it for the time being.

I have to say, some of the functions I've seen in relation to this do look excessively complex and I suspect would be hard to understand for people not familiar with the code, and very hard to test.
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/098f79553745
Upgrade ESLint to version 4.17.0. r=mossop
https://hg.mozilla.org/integration/autoland/rev/584d21820d82
Switch xbl related files to a different method for determining their environment. r=mossop
https://hg.mozilla.org/integration/autoland/rev/89b11edb7dd1
Update complexity rules to adapt for the algorithm in the new ESLint. r=mossop
https://hg.mozilla.org/integration/autoland/rev/2ebcb42faee2
Fix space-unary-ops issues picked up by the new version of ESLint. r=mossop
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.