Enable ESLint no-unused-vars rule for netwerk/cookie/test and netwerk/test
Categories
(Core :: Networking, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: standard8, Assigned: joaovanzuita, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file, 1 obsolete file)
When we initially enabled ESLint for netwerk/, we disabled various rules to make it simpler.
This bug is to enable no-unused-vars for netwerk/cookie/test
and netwerk/test
.
https://searchfox.org/mozilla-central/rev/56bb74ea8e04bdac57c33cbe9b54d889b9262ade/.eslintrc.js#175
Reporter | ||
Comment 1•4 years ago
|
||
To help Mozilla out with this bug, here's the steps:
- Comment here on the bug that you want to volunteer to help. I (or someone else) will assign it to you.
- Follow the guide for contributing: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
- If you have any problems, please ask on Matrix in the #introduction channel. They're there to help you get started.
- Start working on this bug
- Here's what to do:
- Remove the line in the top-level
.eslintrc.js
referenced in comment 0. - Run eslint
./mach eslint netwerk/*
- Fix the issues raised, most of these will fall into the following categories:
- A variable that is unused and has no side-effects, e.g.
var foo = 1
. This can just be removed. - A variable that is unused, but has side-effects, e.g.
let profile = do_get_profile();
. In this case, just remove the variable definition, e.g.do_get_profile();
- A variable assignment to an object or array, e.g.
let [foo, bar] = myfunc()
wherefoo
is unused. Just drop the unnecessary variable, e.g.let [, bar] = myfunc()
. - If you get stuck feel free to ask.
- A variable that is unused and has no side-effects, e.g.
- Do a build and run the tests. For running the tests, I'd suggest:
./mach mochitest netwerk/cookie/test/browser/ netwerk/test/browser/ netwerk/test/mochitests/
./mach xpcshell-test netwerk/test/unit*/
- Create a commit of the manual changes:
$ hg commit -m "Bug nnn - Enable ESLint rule no-unused-vars for all of netwerk/. r?Standard8"
- Post the commits as per the contributing guide.
- Remove the line in the top-level
- Here's what to do:
- Once the patches are submitted, I'll take a look. If there's any changes necessary I'll comment in Phabricator, so be prepared to update the patches. If there's no changes, I'll request review from a netwerk peer, so there may still be more to go.
- If you do need to update the commit, please amend the existing commit, rather than creating new ones. This helps with tracking of review comments.
- Once we're happy with the changes, I'll push it to autoland - our integration branch. Your code will then soon be shipping to Firefox users worldwide!
- Now you get to think about what kind of bug you'd like to work on next. Let me know what you're interested in and I can help you find your next contribution.
Comment 2•4 years ago
|
||
hello, i want to work on it
Reporter | ||
Comment 3•4 years ago
|
||
Hi, please do start working on it, I'll assign it to you. Feel free to ask questions. If you decide at some stage not to continue, that's fine, just please let us know so we can re-assign it.
Comment 4•4 years ago
|
||
I don't want to continue
Reporter | ||
Comment 5•4 years ago
|
||
No problem, thank you for letting us know.
Assignee | ||
Comment 6•4 years ago
|
||
hey Mark, I would like to work on this task. I actually just started.
Reporter | ||
Comment 7•4 years ago
|
||
Hi João, that's great. Let us know if you have any questions.
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Comment 9•4 years ago
|
||
hey Mark,
One test is not passing, and I'm not familiar with the test suit, could you have a look?
I just published the patch here https://phabricator.services.mozilla.com/D92333
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D92333
Assignee | ||
Comment 11•4 years ago
|
||
Missing test was fixed, all tests are passing now.
Updated•4 years ago
|
Reporter | ||
Comment 12•4 years ago
|
||
João, did you see my comments here: https://phabricator.services.mozilla.com/D92333#2996967
Would you be able to try and update the patches please?
Assignee | ||
Comment 13•4 years ago
|
||
Hey Mark, sorry for the delay.
The source control tool is something down my motivation for contributing. I'll follow your advice and ask for help in the channel.
Updated•4 years ago
|
Comment 14•4 years ago
|
||
I would like to work on this card as my first pr, please let me if needed
Reporter | ||
Comment 15•4 years ago
|
||
(In reply to erpandey from comment #14)
I would like to work on this card as my first pr, please let me if needed
Hi, sorry this one is already in progress. There are a couple here that I have that haven't been taken yet: https://codetribute.mozilla.org/projects/ff?project%3DSearch
Updated•4 years ago
|
Reporter | ||
Comment 16•4 years ago
|
||
Taking for now as I'm finishing this off.
Updated•4 years ago
|
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
Reporter | ||
Comment 19•4 years ago
|
||
Assigning this back to João as they did most of the work here - thank you for working on it, I'm sorry it turned out a bit bigger than expected.
Description
•