-
-
Notifications
You must be signed in to change notification settings - Fork 285
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-plugin-node #268
Conversation
3d97fb0
to
ccce5e6
Compare
Can you open an issue on
This too.
And this. |
config/plugins.js
Outdated
// 'node/no-missing-import': 'error', | ||
// 'node/no-missing-require': 'error', | ||
'node/no-unpublished-bin': 'error', | ||
'node/no-unpublished-import': 'error', |
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.
Include electron
and atom
in the allowModules
option: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-import.md#allowmodules For ease of use with Electron and Atom.
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.
Done!
config/plugins.js
Outdated
// 'node/no-missing-require': 'error', | ||
'node/no-unpublished-bin': 'error', | ||
'node/no-unpublished-import': 'error', | ||
'node/no-unpublished-require': 'error', |
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.
Same as above.
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.
Done!
1c7f225
to
ed88204
Compare
mysticatea/eslint-plugin-node#97
mysticatea/eslint-plugin-node#96
I first though it was possible to use both |
ed88204
to
31f6682
Compare
@sindresorhus per this comment we could use the override feature to disable those rules for certain files. In Regarding
What's your thoughts ? |
Yes, let's wait an see the outcome of mysticatea/eslint-plugin-node#96
Let's keep it disabled. I don't want lots of complication for something that is not super useful with latest Node.js, as there are not that many commonly used unsupported features. |
config/plugins.js
Outdated
// Disabled as the rule doesn't allow to exclude compiled sources | ||
// 'node/no-unsupported-features': 'error', | ||
'node/process-exit-as-throw': 'error', | ||
// Disabled as the rule doesn't exclude scripts executed with `node` but not referenced in "bin" (i.e main.js) |
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 link to mysticatea/eslint-plugin-node#96 ?
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.
Done
config/plugins.js
Outdated
// Disabled as the rule doesn't exclude scripts executed with `node` but not referenced in "bin" (i.e main.js) | ||
// 'node/shebang': 'error', | ||
'node/no-deprecated-api': 'error', | ||
'node/exports-style': ['error', 'module.exports', {allowBatchAssign: true}] |
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 don't think allowBatchAssign
should be true
. It's not a good pattern.
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.
Done
31f6682
to
66494ef
Compare
This is something we can implement within the scope of #266 |
Agreed :) |
Great! Thank you 🙌 Would you be interested in joining the project? You have done some high-quality contributions :) |
I'll take a stab at #266 sometime (in a weeks I guess). |
Absolutely ! |
Fixes #123
Add the following rules:
import
declarations of private thingsrequire()
expressions of private thingsprocess.exit()
expressions the same code path asthrow
The other rules provided are disabled for the following reasons:
import/no-extraneous-dependencies
import/no-extraneous-dependencies
import/no-unresolved
import/no-unresolved
exports-styleToo restrictive, forces to use eithermodules.exports
orexports
but not bothLet me know if I should make changes in the rules enabled/disabled or in the configuration.