-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#!/usr/bin/env node | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 😄 |
||
|
||
var Suites = require('./suite'); | ||
var suites = new Suites(); | ||
|
||
var regexIdx = process.argv.indexOf('--regex') + 1; | ||
if (regexIdx > 0) { | ||
if (regexIdx === process.argv.length) { | ||
console.error('Error: the "--regex" option requires a value'); | ||
process.exit(1); | ||
throw new Error('Error: the "--regex" option requires a value'); | ||
} | ||
suites.filter(process.argv[regexIdx]); | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.