Fix ESLint rule warnings for no-unused-vars in caps/tests/unit/test_origin.js
Categories
(Core :: Security: CAPS, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: Akasha.Rojee, Assigned: bxbrenden, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file)
Steps to reproduce:
-
In ESLint config file, remove this line.
-
Run
./mach eslint caps/tests/unit/test_origin.js
Actual results:
ESLint gives a no-unused-vars
error on the function printAttrs
.
55:10 error 'printAttrs' is defined but never used. no-unused-vars (eslint)
✖ 1 problem (1 error, 0 warnings, 0 fixed)
Expected results:
There should not be any error.
@standard8 I am working on this but need to clarify the following, please.
printAttrs
is a utility function used in debugging.
The lines calling it are commented. Do we uncomment those lines, or do we comment the function printAttrs
too?
Or do we configure ESLint to ignore the function printAttrs
for the rule no-unused-vars
?
Comment 2•2 years ago
|
||
(In reply to Akasha from comment #1)
printAttrs
is a utility function used in debugging.The lines calling it are commented. Do we uncomment those lines, or do we comment the function
printAttrs
too?Or do we configure ESLint to ignore the function
printAttrs
for the ruleno-unused-vars
?
Thanks for asking, I think in this case, as this is a test file, and that's useful for debugging, lets go with ignoring it, i.e. // eslint-disable-next-line no-unused-vars
. That'll make it easier if it does get used again.
Comment 3•2 years ago
|
||
I'm assigning this to you Akasha as you're working on it.
Comment 5•2 years ago
|
||
No response, so I'm assuming Akasha isn't working on this. Opening it up for others.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Pushed by bhyde@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a7140adcd96 Configure eslint to disable check for unused variable "printAttrs" r=Standard8 DONTBUILD
Comment 8•2 years ago
|
||
bugherder |
Description
•