Enable ESLint for parser/

RESOLVED FIXED in Firefox 65

Status

()

P3
normal
RESOLVED FIXED
5 months ago
4 months ago

People

(Reporter: standard8, Assigned: r2hkri, Mentored)

Tracking

(Blocks: 1 bug, {good-first-bug})

Trunk
mozilla65
good-first-bug
Points:
---

Firefox Tracking Flags

(firefox65 fixed)

Details

(Whiteboard: [lang=js])

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

5 months ago
As part of rolling out ESLint across the tree, we should enable it for the parser/ directories.

I'm happy to mentor this bug. There's background on our eslint setups here:

https://developer.mozilla.org/docs/ESLint

Please note: We want to end up with two separate commits. One with the automatic changes, the second with the manual changes. It helps with reviewing if these appear as a commit series in phabricator.

Here's some approximate steps:

- In .eslintignore, remove the `parser/**` line.

- Run eslint:

./mach eslint --fix parser

This should fix most/all of the issues.

- Inspect the diff to make sure that the indentation of the lines surrounding the changes look ok.

- Create a commit of the work so far, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for parser/ (automatic changes)" parser/

- For the remaining issues, you'll need to fix them by hand. Most of those should be reasonably easy to understand, but there's more information on some specific bits (especially no-undef) here:

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint#Common_issues_and_how_to_solve_them
http://eslint.org/docs/rules/

(you can just run `./mach eslint parser` to check you've fixed them).

- Create a second commit of the manual changes, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for parser/ (manual changes)"

- Post the two commits via phabricator: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html
When you post, please request initial review from myself (`standard8`), I'll then redirect to the owners of the code if the changes look good.
Priority: -- → P3
Having a look at this one
Comment hidden (obsolete)
(Reporter)

Updated

5 months ago
Assignee: nobody → riccardo.bellingeri
(Reporter)

Comment 3

4 months ago
Riccardo has told me he's no longer working on this, so opening up again.
Assignee: riccardo.bellingeri → nobody
(Assignee)

Comment 4

4 months ago
I would like to try this, thanks!
(Reporter)

Comment 5

4 months ago
(In reply to r2hkri from comment #4)
> I would like to try this, thanks!

Hi, please do. Feel free to ask here or on irc if you have any questions (https://wiki.mozilla.org/Irc #introduction).
Assignee: nobody → r2hkri
(Assignee)

Comment 6

4 months ago
I'm running into a problem where a variable is defined in an (x)html file and then referenced inside a loaded script. For example:

https://searchfox.org/mozilla-central/source/parser/htmlparser/tests/mochitest/test_bug688580.html#23
https://searchfox.org/mozilla-central/source/parser/htmlparser/tests/mochitest/file_bug688580.js#2

I tried the suggestions from https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint#no-undef and none of them worked or fit the case. I also can't do something like /* globals state */ without also disabling the no-global-assign rule.
(Assignee)

Comment 8

4 months ago
Depends on D11920
Attachment #9026442 - Attachment is obsolete: true
(Reporter)

Comment 10

4 months ago
Blake, could you have a look at the automatic changes as well please. Although Phabricator is saying "needs revision", I think it is currently confused...
Flags: needinfo?(mrbkap)
Sorry, I misread the Phabricator queue.
Flags: needinfo?(mrbkap)

Comment 12

4 months ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f456b3dd43c0
Enable ESLint for parser/ (automatic fixes) r=Standard8,mrbkap
https://hg.mozilla.org/integration/autoland/rev/7c02d6c28133
Enable ESLint for parser/ (manual fixes) r=Standard8,mrbkap

Comment 13

4 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f456b3dd43c0
https://hg.mozilla.org/mozilla-central/rev/7c02d6c28133
Status: NEW → RESOLVED
Last Resolved: 4 months ago
status-firefox65: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.