Skip to content
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

Merged
merged 1 commit into from
Apr 14, 2016

Conversation

lencioni
Copy link
Contributor

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.

@lencioni lencioni force-pushed the eslint-plugin-import branch from 3ab2ee4 to a36ddec Compare April 13, 2016 22:16
'settings': {
'import/resolver': {
'node': {
'extensions': ['.js', '.jsx', '.json']
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@lencioni
Copy link
Contributor Author

I found a couple more that I think we should enable. Stand by.

@lencioni
Copy link
Contributor Author

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';`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done!

@lencioni lencioni force-pushed the eslint-plugin-import branch from 764a886 to 99a62f8 Compare April 13, 2016 23:41
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.
@lencioni lencioni force-pushed the eslint-plugin-import branch from 99a62f8 to 0fe4f55 Compare April 14, 2016 00:13
@ljharb ljharb merged commit 4af3f97 into airbnb:master Apr 14, 2016
@lencioni lencioni deleted the eslint-plugin-import branch April 14, 2016 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants