Skip to content

Commit

Permalink
[Docs] 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 authored and ljharb committed May 21, 2020
1 parent 0e5bed9 commit 515957a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- [readme] Remove duplicate no-unused-modules from docs ([#1690], thanks [@arvigeus])
- [Docs] `order`: fix bad inline config ([#1788], thanks [@nickofthyme])
- [Tests] Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth])
- [Docs] `no-unused-rules`: Fix docs for unused exports ([#1776], thanks [@barbogast])

## [2.20.2] - 2020-03-28
### Fixed
Expand Down Expand Up @@ -687,6 +688,7 @@ for info on changes for earlier releases.
[#1788]: https://github.com/benmosher/eslint-plugin-import/pull/1788
[#1786]: https://github.com/benmosher/eslint-plugin-import/pull/1786
[#1785]: https://github.com/benmosher/eslint-plugin-import/pull/1785
[#1776]: https://github.com/benmosher/eslint-plugin-import/pull/1776
[#1770]: https://github.com/benmosher/eslint-plugin-import/pull/1770
[#1764]: https://github.com/benmosher/eslint-plugin-import/pull/1764
[#1763]: https://github.com/benmosher/eslint-plugin-import/pull/1763
Expand Down Expand Up @@ -1180,3 +1182,4 @@ for info on changes for earlier releases.
[@julien1619]: https://github.com/julien1619
[@darkartur]: https://github.com/darkartur
[@MikeyBeLike]: https://github.com/MikeyBeLike
[@barbogast]: https://github.com/barbogast
14 changes: 4 additions & 10 deletions docs/rules/no-unused-modules.md
Original file line number Diff line number Diff line change
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 515957a

Please sign in to comment.