Skip to content

Commit

Permalink
[no-unused-rules]: Fix docs for unused exports
Browse files Browse the repository at this point in the history
First change: Change `import * from  'file-c'` to `import * as fileC from  'file-c'`. The former isn't valid javascript, right?

Second change: Remove example 'file-d', I couldn't see a difference from 'file-c'

Third change: Rename 'file-e' to 'file-d'.
  • Loading branch information
barbogast committed May 21, 2020
1 parent 3f46ccf commit dfb3dc6
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions docs/rules/no-unused-modules.md
Expand Up @@ -58,28 +58,22 @@ given file-f:
```js
import { e } from 'file-a'
import { f } from 'file-b'
import * from 'file-c'
export * from 'file-d'
export { default, i0 } from 'file-e' // both will be reported
import * as fileC from 'file-c'
export { default, i0 } from 'file-d' // both will be reported

export const j = 99 // will be reported
```
and file-e:
and file-d:
```js
export const i0 = 9 // will not be reported
export const i1 = 9 // will be reported
export default () => {} // will not be reported
```
and file-d:
and file-c:
```js
export const h = 8 // will not be reported
export default () => {} // will be reported, as export * only considers named exports and ignores default exports
```
and file-c:
```js
export const g = 7 // will not be reported
export default () => {} // will not be reported
```
and file-b:
```js
import two, { b, c, doAnything } from 'file-a'
Expand Down

0 comments on commit dfb3dc6

Please sign in to comment.