Closed Bug 1543656 Opened 5 years ago Closed 5 years ago

[remote-dbg-next] .eslintignore does not ignore node_modules folder in test/jest

Categories

(DevTools :: about:debugging, defect, P1)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: ogasidlo, Assigned: ogasidlo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [remote-debugging-reserve] remote-debugging-technical-debt)

Attachments

(1 file)

As we have a contained environment for our jest tests in test/jest and a separate package.json, we also have a node_modules folder.

This folder is automatically ignored by mercurial, so will not be staged for a commit. But it is picked up by our linter.

STR:

  1. Go to devtools/client/aboutdebugging-new/test/jest
  2. Run yarn install to create the node_modules folder
  3. Go back to root and run ./mach lint --fix devtools/client/aboutdebugging-new/

ER:
Linter does not throw errors for node_modules

AR:

mozilla-central/devtools/client/aboutdebugging-new/test/jest/node_modules/nan/nan.
  2037   error  Virtual function declarations should specify only one of `virtual`, `final`, or `override`  (cpp-virtual-final)
  2132   error  Virtual function declarations should specify only one of `virtual`, `final`, or `override`  (cpp-virtual-final)

✖ 2 problems (2 errors, 0 warnings)

Solving this issue with an .eslintignore on the test/jest level should work, but doesn't as clang is not picking up on the ignore file.

clang ignore file is https://searchfox.org/mozilla-central/source/.clang-format-ignore , .eslintignore will not be picked up by clang.

Priority: -- → P3
Whiteboard: remote-debugging-technical-debt

As we want to exclude JS code, this needs to go into tools/rewriting/ThirdPartyPaths.txt.
.clang-format-ignore is just for C++ / Objective-C code.

(In reply to Ola Gasidlo [:ogasidlo] [:ola] from comment #2)

As we want to exclude JS code, this needs to go into tools/rewriting/ThirdPartyPaths.txt.
.clang-format-ignore is just for C++ / Objective-C code.

Ah good to know that the linter ignore file is a separate one. Note that it's not JS we want to ignore, but C++, if you look in devtools/client/aboutdebugging-new/test/jest/node_modules/nan/nan, it's filled with *.h files :)

As the third-party node modules are throwing errors while running ./mach lint, the path was added to the ignore list for third party folders / files.

Assignee: nobody → ogasidlo
Status: NEW → ASSIGNED
Priority: P3 → P1
Whiteboard: remote-debugging-technical-debt → [remote-debugging-reserve] remote-debugging-technical-debt
Pushed by ogasidlo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec1348093b6e Added node_modules folder in jest tests to list so it will be ignored by linter. r=ladybenko,sylvestre,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: