-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ESLint no-unused-vars rule #1497
Conversation
I'd rather we add |
package.json
Outdated
}, | ||
"scripts": { | ||
"test": "tape test/test-*" | ||
"lint": "node_modules/eslint/bin/eslint.js --no-eslintrc --rule no-unused-vars:error bin lib test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not just do:
- "lint": "node_modules/eslint/bin/eslint.js --no-eslintrc --rule no-unused-vars:error bin lib test",
+ "lint": "eslint --no-eslintrc --rule no-unused-vars:error bin lib test",
Also is there a reason to add the lint rules here instead of just adding a .eslintrc.yaml
? I assume we're going to add more rules in the future...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had listed just the one rule for now, since didn't want to introduce tons of style changes all at once (and different parts of the codebase follow different standards...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I didn't mean that you should add a full set of rules, just that adding a second rule will be a lot easier if it's just adding a line to a yaml file.
I think using .eslintrc.yaml
is the convention in everything but nodejs/node (and that's a recent change).
@gibfahn Added |
@maclover7 fixed the job error - Test run: https://ci.nodejs.org/job/nodegyp-test-commit/391/nodes=win2016-vs2017/console About the new error, can you use just |
CI (https://ci.nodejs.org/job/nodegyp-test-pull-request/77/) is passing now besides for Node.js v4.x, but support for that release line is being removed soon from the master branch. PTAL @gibfahn @joaocgreis |
Windows fix LGTM. The rest of the diff looks reasonable at a glance but I didn't test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
@maclover7 just to confirm, all the fixes come from eslint warnings right? |
@gibfahn Yep, they came from when I ran |
- Uses `.eslintrc.yaml` for configuration - `npm run lint` is part of `npm test`
Final CI before landing: https://ci.nodejs.org/job/nodegyp-test-pull-request/81/ |
Landed in b2e5cf0 |
- Uses `.eslintrc.yaml` for configuration - `npm run lint` is part of `npm test` PR-URL: #1497 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: João Reis <[email protected]>
Checklist
npm install && npm test
passesDescription of change
Adds the
no-unused-vars
ESLint rule. Can addnpm run lint
tonodegyp-test-commit
if people would like that.