Closed Bug 1761614 Opened 2 years ago Closed 2 years ago

Fix ESLint rule warnings for no-unused-vars in caps/tests/unit/test_origin.js

Categories

(Core :: Security: CAPS, defect, P3)

defect

Tracking

()

RESOLVED FIXED
105 Branch
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.

Blocks: 1612907
Mentor: standard8
Version: Firefox 100 → unspecified

@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?

Flags: needinfo?(standard8)

(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 rule no-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.

Flags: needinfo?(standard8)

I'm assigning this to you Akasha as you're working on it.

Assignee: nobody → Akasha.Rojee
Status: UNCONFIRMED → NEW
Component: Lint and Formatting → Security: CAPS
Ever confirmed: true
Product: Firefox Build System → Core

Hi Akasha, Are you still working on this?

Flags: needinfo?(Akasha.Rojee)

No response, so I'm assuming Akasha isn't working on this. Opening it up for others.

Assignee: Akasha.Rojee → nobody
Flags: needinfo?(Akasha.Rojee)
Keywords: good-first-bug
Whiteboard: [lang=js]
Severity: -- → S4
Priority: -- → P3
Assignee: nobody → bhyde
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
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: