Skip to content

Commit

Permalink
Enable import/no-namespace rule
Browse files Browse the repository at this point in the history
This rule enforces our "Do not use wildcard imports" guideline.

  https://github.com/airbnb/javascript#modules--no-wildcard
  • Loading branch information
lencioni committed Apr 13, 2016
1 parent e10c1bf commit 99a62f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ Other Style Guides
```
<a name="modules--no-wildcard"></a><a name="10.2"></a>
- [10.2](#modules--no-wildcard) Do not use wildcard imports.
- [10.2](#modules--no-wildcard) Do not use wildcard imports. eslint: [`import/no-namespace`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md)
> Why? This makes sure you have a single default export.
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-config-airbnb/rules/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ module.exports = {
// 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';`
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
'import/no-namespace': 2,
// ensure imports point to files/modules that can be resolved
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
'import/no-unresolved': [2, { 'commonjs': true }]
Expand Down

0 comments on commit 99a62f8

Please sign in to comment.