Enable eslint no-undef for toolkit

RESOLVED FIXED in Firefox 54

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

unspecified
mozilla54
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(2 attachments)

I'm working on a couple of patches to get no-undef enabled for all of toolkit/. We're not far off now, so hopefully I'll have this up in a few days.
Note: I can't land this until the dependent bugs land, but lets get it reviewed & ready so that we can land it fairly soon to avoid more no-undefs creeping in.

Comment 4

2 years ago
mozreview-review
Comment on attachment 8839900 [details]
Bug 1341029 - Add more 'globals' for browserjs equivalent imports, and for test imports.

https://reviewboard.mozilla.org/r/114490/#review116002
Attachment #8839900 - Flags: review?(dtownsend) → review+
Comment on attachment 8839901 [details]
Bug 1341029 - Turn on the ESLint no-undef rule for all of toolkit/.

https://reviewboard.mozilla.org/r/114492/#review116146

This is great! Thank you for doing this! :)

::: toolkit/components/.eslintrc.js:3
(Diff revision 1)
>  module.exports = {
>    "rules": {
> -    "no-undef": "off"
>    }

Can this file be removed now?

::: toolkit/content/.eslintrc.js:5
(Diff revision 1)
>  "use strict";
>  
>  module.exports = {
>    "rules": {
> -    "no-undef": "off"
> +    "mozilla/import-browserjs-globals": "warn",

Is there a plan for marking "import-browserjs-globals" as "error" ?

::: toolkit/content/widgets/colorpicker.xml
(Diff revision 1)
>  
>    <binding id="colorpickertile" role="xul:colorpickertile">
>    </binding>
>  
>  </bindings>
> -

Should we keep a newline at the end of this file?

::: toolkit/content/widgets/toolbar.xml
(Diff revision 1)
>        <xul:label xbl:inherits="value=title"/>
>      </content>
>    </binding>
>  
>  </bindings>
> -

Should we keep a newline at the end of this file?
Attachment #8839901 - Flags: review?(jaws) → review+
Assignee

Comment 6

2 years ago
mozreview-review-reply
Comment on attachment 8839901 [details]
Bug 1341029 - Turn on the ESLint no-undef rule for all of toolkit/.

https://reviewboard.mozilla.org/r/114492/#review116146

> Can this file be removed now?

I was debating about it as we might want it for other things, but lets drop it for now.

> Is there a plan for marking "import-browserjs-globals" as "error" ?

I don't think it really matters, as the rule doesn't produce anything that is an error or not.

> Should we keep a newline at the end of this file?

There is for both of these, my editor was automatically removing an extra newline at the end of the file.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 9

2 years ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/96e5f8480e11
Add more 'globals' for browserjs equivalent imports, and for test imports. r=mossop
https://hg.mozilla.org/integration/autoland/rev/6055065a2ed5
Turn on the ESLint no-undef rule for all of toolkit/. r=jaws

Comment 10

2 years ago
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/bba5e0634259
Turn on the ESLint no-undef rule for all of toolkit/: revert an assert argument back to true. r=intermittent-fix

Comment 11

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/96e5f8480e11
https://hg.mozilla.org/mozilla-central/rev/6055065a2ed5
https://hg.mozilla.org/mozilla-central/rev/bba5e0634259
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54

Updated

2 years ago
Depends on: 1348954
You need to log in before you can comment on or make changes to this bug.