Closed Bug 1344027 Opened 7 years ago Closed 7 years ago

Get most of browser/components passing ESLint's no-undef rule

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 54
Tracking Status
firefox54 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(5 files)

I've got a couple of patches that get browser/components passing the no-undef rule save for three issues that are covered by other bugs.

Since they're quite big, and I'd like to be able to start working towards browser/content whilst waiting for those, I think now is a good time to land them.

The first one is to fixup the import-global-from option to allow circular references - browser/components/preferences is particularly bad at including multiple things different ways across files.

The second is the general fixes to browser/components to get the rule passing.
Comment on attachment 8843266 [details]
Bug 1344027 - Fix most of the remaining ESLint no-undef issues in browser/components.

https://reviewboard.mozilla.org/r/117070/#review118742
Attachment #8843266 - Flags: review?(jaws) → review+
Comment on attachment 8843263 [details]
Bug 1344027 - Change the import-global-from option for eslint to allow circular references and resolve most of the no-undef issues in browser/components/preferences.

https://reviewboard.mozilla.org/r/117064/#review118790

::: tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js:67
(Diff revision 1)
>  /**
> + * Global discovery can occasionally meet circular dependencies due to the way
> + * js files are included via xul files etc. This array is used to avoid getting
> + * into loops whilst the discovery is in progress.
> + */
> +var globalDiscoveryInProgressForFiles = [];

This could be a Set

::: tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js:194
(Diff revision 1)
>      globalCache.set(path, globals);
>  
> +    let position = globalDiscoveryInProgressForFiles.indexOf(path);
> +    if (position != -1) {
> +      globalDiscoveryInProgressForFiles.splice(position, 1);
> +    }

Then this would be easier to do!
Attachment #8843263 - Flags: review?(dtownsend) → review+
Comment on attachment 8843264 [details]
Bug 1344027 - Add a places-overlay environment for ESLint for when placesOverlay.xul is included.

https://reviewboard.mozilla.org/r/117066/#review118798
Attachment #8843264 - Flags: review?(dtownsend) → review+
Comment on attachment 8843265 [details]
Bug 1344027 - Move eslint-plugin-mozilla's .eslintrc.js file so that all of the plugin is linted, and fix the resulting issues.

https://reviewboard.mozilla.org/r/117068/#review118800
Attachment #8843265 - Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b5cf23ffc1d0
Change the import-global-from option for eslint to allow circular references and resolve most of the no-undef issues in browser/components/preferences. r=mossop
https://hg.mozilla.org/integration/autoland/rev/bdd4e1f734a2
Add a places-overlay environment for ESLint for when placesOverlay.xul is included. r=mossop
https://hg.mozilla.org/integration/autoland/rev/feea1e54c19b
Move eslint-plugin-mozilla's .eslintrc.js file so that all of the plugin is linted, and fix the resulting issues. r=mossop
https://hg.mozilla.org/integration/autoland/rev/8947d02cec5d
Fix most of the remaining ESLint no-undef issues in browser/components. r=jaws
This is a bustage fix for eslint - unfortunately running on Mac got away with the case sensitive issues of "fontbuilder.js" (not fontBuilder.js).
Attachment #8843744 - Flags: review+
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/323e5db6b459
Follow-up to bug 1344027 - fix capitalisation of fontbuilder.js. rs=bustage-fix for eslint.
You need to log in before you can comment on or make changes to this bug.