Closed Bug 1588872 Opened 28 days ago Closed 27 days ago

Running npm test from mc causes missing lint rule errors

Categories

(Firefox :: Messaging System, defect)

defect
Not set
Points:
1

Tracking

()

RESOLVED FIXED
Firefox 71
Iteration:
71.4 - Oct 14 - 20
Tracking Status
firefox71 --- fixed

People

(Reporter: k88hudson, Assigned: standard8)

References

Details

Attachments

(1 file)

Running npm test --prefix browser/components/newtab from the root of MC fails because it appears to be missing packages, even after npm installing. No lint errors show up from mach lint. Output looks like this:

...browser/components/newtab/test/xpcshell/test_AboutNewTabService.js
  1:1  error  Definition for rule 'mozilla/prefer-boolean-length-check' was not found  mozilla/prefer-boolean-length-check

Bug 1578190 adding prefer-boolean-length-check landed without changing eslint-plugin-mozilla from 2.1.0, which is still the latest published package from 2 months ago.

Depends on: 1578190

I suppose more from bug 1578683 turning it on for browser/

Depends on: 1578683

Looks like we can add "mozilla/prefer-boolean-length-check": 0 to browser/components/newtab/.eslintrc and it'll ignore the rule from activity-stream and mozilla-central repositories (even though in the former, it doesn't even know about the rule).

(In reply to Ed Lee :Mardak from comment #1)

Bug 1578190 adding prefer-boolean-length-check landed without changing eslint-plugin-mozilla from 2.1.0, which is still the latest published package from 2 months ago.

I expect we should fix this either way - Mark?

Flags: needinfo?(standard8)

Ah yes, I'd forgotten about the possible effects on newtab code when we originally enabled it, and I thought adding to just the top-level we'd get away with it.

So I'm just about to attach a patch to set it as default in recommended.js, and disable the other directories where it fails. I'll also bump the versions at the same time so we can publish a new one.

It also reminds me to suggest to Monika that we can probably now enable it for more directories as well :-)

Flags: needinfo?(standard8)
Assignee: nobody → standard8
Iteration: --- → 71.4 - Oct 14 - 20
Points: --- → 1
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c33ead05e1d8
Enable ESLint rule mozilla/prefer-boolean-length-check by default, disable for failing locations. r=Mardak
Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71

I've just published 2.2.0.

You need to log in before you can comment on or make changes to this bug.