-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(lint): Add jest & node eslint plugins #1642
Conversation
And fixes all reported issues.
benchmark/benchmark.js
Outdated
@@ -1,13 +1,10 @@ | |||
#!/usr/bin/env node |
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.
I'd keep the shebang since the script is a CLI script
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.
eslint-plugin-node
's recommended config only allows a shebang when the script is actually a part of the package.json
's bin
s. There isn't too much of a point for exposing this externally, so removing it seems reasonable. We always call this with node
anyway, so nothing should change.
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.
Yeah, exactly why the shebang should stay :)
IMO this is wrong, and the file should be treated as a CLI script since that's what it is.
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.
See also mysticatea/eslint-plugin-node#96
and https://github.com/xojs/xo/blob/master/config/plugins.js#L309-L310
Personally, I'd disable the rule and keep the shebang.
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.
Thanks a lot for the references. This was super helpful, I'm convinced 😄
.eslintrc.json
Outdated
"globals": { "Set": true, "Symbol": true }, | ||
"rules": { | ||
// TODO |
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.
Might be worth renaming .eslintrc.json to .eslintrc.js later so that the file is valid, but that's nitpicking since ESLint works with comments in JSON too.
BTW you could set it to 4.5.0 so that it works, but the discrepancy between the engines version and the current code will still exist.
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.
Yeah — we really need to find a solution for this. I've disabled the rule for now and will revisit it soon.
And fixes all reported issues.