Closed Bug 1343519 Opened 7 years ago Closed 7 years ago

Clean up some of eslint-plugin-mozilla - change some rules to be environments and automatically parse global-scripts.inc

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

3 Branch
enhancement
Not set
normal

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(5 files)

I've discovered that we can move some more of our rules to be environments - which will be better as it'll just be a one-off cost for setup.

Additionally in doing this I think we can introduce parsing of global-scripts.inc which means we shouldn't have to update the list of imported scripts too often (which will also help the no-undef work).
Depends on: 1343521
Note: For eslint to pass, this also needs bug 1343521 (which is currently on autoland). Otherwise you get "Read-only global 'Social' should not be modified  no-native-reassign" which is due to better detection of globals and not allowing them to be modified when they shouldn't be.
Comment on attachment 8842610 [details]
Bug 1343519 - Change some function calls from using 'this' to 'context' in the eslint-plugin-mozilla code so that it works correctly when timing rule lengths.

https://reviewboard.mozilla.org/r/116386/#review118016
Attachment #8842610 - Flags: review?(dtownsend) → review+
Comment on attachment 8842611 [details]
Bug 1343519 - Change the ESLint rule 'import-browserjs-globals' to be an environment (mozilla/browser-window) to better describe the purpose of it.

https://reviewboard.mozilla.org/r/116388/#review118072
Attachment #8842611 - Flags: review?(dtownsend) → review+
Comment on attachment 8842612 [details]
Bug 1343519 - Change the ESLint rule 'import-test-globals' to be an environment (mozilla/simpletest) to better describe the purpose of it.

https://reviewboard.mozilla.org/r/116390/#review118074
Attachment #8842612 - Flags: review?(dtownsend) → review+
Comment on attachment 8842613 [details]
Bug 1343519 - Change the ESLint browser-window environment to determine most of the scripts for globals by parsing global-scripts.inc.

https://reviewboard.mozilla.org/r/116392/#review118076
Attachment #8842613 - Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/64ebe0113929
Change some function calls from using 'this' to 'context' in the eslint-plugin-mozilla code so that it works correctly when timing rule lengths. r=mossop
https://hg.mozilla.org/integration/autoland/rev/563299ade2ae
Change the ESLint rule 'import-browserjs-globals' to be an environment (mozilla/browser-window) to better describe the purpose of it. r=mossop
https://hg.mozilla.org/integration/autoland/rev/8dbddf1d169e
Change the ESLint rule 'import-test-globals' to be an environment (mozilla/simpletest) to better describe the purpose of it. r=mossop
https://hg.mozilla.org/integration/autoland/rev/72b573571f72
Change the ESLint browser-window environment to determine most of the scripts for globals by parsing global-scripts.inc. r=mossop
I forgot to bump the version number when I was moving patches around. This fixes that.
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/180a160ae22a
Bump the version number for eslint-plugin-mozilla for the changes. r=bustage-fix-for-developers a=tomcat
Depends on: 1344690
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.