-
Notifications
You must be signed in to change notification settings - Fork 26.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
Enable import/no-unresolved and import/export rules #825
Conversation
3ab2ee4
to
a36ddec
Compare
'settings': { | ||
'import/resolver': { | ||
'node': { | ||
'extensions': ['.js', '.jsx', '.json'] |
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.
es6
probably shouldn't include jsx
- and actually, probably react
should be the file where jsx
is added.
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!
4ec5d2c
to
e10c1bf
Compare
I found a couple more that I think we should enable. Stand by. |
Alrighty, this is ready to go. |
// disallow invalid exports, e.g. multiple defaults | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md | ||
'import/export': 2, | ||
// prevents `import * from 'foo';` |
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 we add the rule link to https://github.com/airbnb/javascript#modules--no-wildcard ?
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.
Good call. Done!
764a886
to
99a62f8
Compare
These come from eslint-plugin-import. We've been using these rules for a while at Airbnb so it seems like a good time to include them in this configuration. We've found the no-unresolved rule in particular to be very helpful when working across a large codebase. https://github.com/benmosher/eslint-plugin-import Since the no-unresolved rule works on commonjs, I decided to include it in the node configuration as well. I think there are some more rules from this plugin that are worth enabling, but this seems like a great place to start.
99a62f8
to
0fe4f55
Compare
These come from eslint-plugin-import. We've been using a couple of these rules for a
while at Airbnb so it seems like a good time to include them in this
configuration. We've found the no-unresolved rule in particular to be
very helpful when working across a large codebase.
https://github.com/benmosher/eslint-plugin-import
Since the no-unresolved rule works on commonjs, I decided to include it
in the node configuration as well.