Point npm run testmc to use mach to avoid error with linting
Categories
(Firefox :: New Tab Page, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox72 | --- | unaffected |
firefox73 | --- | unaffected |
firefox74 | --- | fixed |
People
(Reporter: thecount, Assigned: Mardak)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
From inside /browser/components/newtab
If you try to run npm run testmc
You get and error:
Error: Cannot read config file: /home/scott/mozilla-central/.eslintrc.js
Error: ENOENT: no such file or directory, open 'tools/rewriting/ThirdPartyPaths.txt'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.<anonymous> (/home/scott/mozilla-central/.eslintrc.js:37:9)
at Module._compile (/home/scott/mozilla-central/browser/components/newtab/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (/home/scott/mozilla-central/browser/components/newtab/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
Failed to parse JSON:
Unexpected end of JSON input
I ran a bisect and found https://bugzilla.mozilla.org/show_bug.cgi?id=1607172 to be the first instance of this issue.
Assignee | ||
Comment 1•5 years ago
|
||
This fails because the m-c/.eslintrc.js
is loaded when running m-c/browser/components/newtab/node_modules/.bin/eslint
. I suppose a couple possible fixes could involve setting root: true
from browser/components/newtab/.eslintrc.js
or have m-c/.eslintrc.js
add ignores only when invoked at m-c root.
Separately, this shows that browser/components/newtab$ npm run lint:eslint
isn't run by automation (https://searchfox.org/mozilla-central/source/browser/components/newtab/bin/try-runner.js) which currently does karma and sasslint; and presumably not eslint because it is normally covered by ./mach lint
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Ed, I've not tested the patch with newtab code, but I think it'd probably work... feel free to land it if there's no changes required.
Assignee | ||
Comment 4•5 years ago
|
||
Ah meh this current patch then runs into a related issue that browser/components/newtab/package.json says eslint@6.2.2 resulting in:
Error: ESLint configuration in ../../../.eslintrc.js is invalid:
- Unexpected top-level property "ignorePatterns".
Maybe the more interesting question (but probably unblock local-dev newtab eslint failing first) is whether browser/components/newtab should even be doing eslint/prettier separately from ./mach lint
anymore given that development is only happening from the context of mozilla-central now. This would avoid needing to keep eslint version matching root, and potentially we could just have npm run lint:eslint
call mach lint -l eslint browser/components/newtab
… ?
Comment 5•5 years ago
|
||
(In reply to Ed Lee :Mardak from comment #4)
Maybe the more interesting question (but probably unblock local-dev newtab eslint failing first) is whether browser/components/newtab should even be doing eslint/prettier separately from
./mach lint
anymore given that development is only happening from the context of mozilla-central now. This would avoid needing to keep eslint version matching root, and potentially we could just havenpm run lint:eslint
callmach lint -l eslint browser/components/newtab
… ?
If everything is happening in m-c now, then I think it'd definitely be worth changing it. It looks like it is all linted from the top-level of m-c anyway. Maybe keep the browser/components/newtab/.eslintrc.js
as it is for now, but drop the associated .eslintignore.
If you wanted the quick developer fix, then you could probably just change that npm command, and remove ESLint from package.json later?
Comment hidden (obsolete) |
Comment 7•5 years ago
|
||
Ah, I skimmed too fast; never mind! Marking my comment obsolete.
Assignee | ||
Comment 8•5 years ago
|
||
I'll fix up the command and maybe clean up a little bit. This only affects a few devs right now who can workaround by doing npm run testmc:unit
to skip the lint step.
Assignee | ||
Comment 9•5 years ago
|
||
Depends on D60757
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D60894
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Pushed by elee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/234c4a6c77aa When loading files for ignoring lists in ESLint, use the absolute path. r=Mardak
Updated•5 years ago
|
Comment 12•5 years ago
|
||
bugherder |
Comment 13•5 years ago
|
||
Pushed by elee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/31addc1c7666 Point npm run testmc to use mach to avoid error with linting r=thecount
Comment 14•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•