Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmarek committed Apr 16, 2017
1 parent 2894b49 commit e2f13a7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions docs/rules/no-import-module-exports.md
Expand Up @@ -3,20 +3,19 @@
Reports the use of import declarations with CommonJS exports in any module
except for the [main module](https://docs.npmjs.com/files/package.json#main).

If you have multiple entry points, or are using `js:next` this rule includes an
If you have multiple entry points or are using `js:next` this rule includes an
`exceptions` option which you can use to exclude those files from the rule.

## Options

#### `exceptions`
An array of globs. The rule will be omitted from any file that matches a glob in
the options array.

For example, the following setting will omit the rule in the `some-file.js` file.
- An array of globs. The rule will be omitted from any file that matches a glob
in the options array. For example, the following setting will omit the rule
in the `some-file.js` file.

```json
"import/no-import-module-exports": ["error", {
"exceptions": ['**/*/some-file.js']
"exceptions": ["**/*/some-file.js"]
}]
```

Expand Down Expand Up @@ -61,12 +60,12 @@ exports.foo = bar
import thing from 'otherthing'
console.log(thing.module.exports)

/* in lib/index.js */
// in lib/index.js
import foo from 'path';
module.exports = foo;

/* in some-file.js */
/* eslint import/no-import-module-exports: ["error", {"exceptions": ['**/*/some-file.js']}] */
// in some-file.js
// eslint import/no-import-module-exports: ["error", {"exceptions": ["**/*/some-file.js"]}]
import foo from 'path';
module.exports = foo;
```

0 comments on commit e2f13a7

Please sign in to comment.