Skip to content

Commit 515957a

Browse files
barbogastljharb
authored andcommitted
[Docs] no-unused-rules: Fix docs for unused exports
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'.
1 parent 0e5bed9 commit 515957a

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
2727
- [readme] Remove duplicate no-unused-modules from docs ([#1690], thanks [@arvigeus])
2828
- [Docs] `order`: fix bad inline config ([#1788], thanks [@nickofthyme])
2929
- [Tests] Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth])
30+
- [Docs] `no-unused-rules`: Fix docs for unused exports ([#1776], thanks [@barbogast])
3031

3132
## [2.20.2] - 2020-03-28
3233
### Fixed
@@ -687,6 +688,7 @@ for info on changes for earlier releases.
687688
[#1788]: https://github.com/benmosher/eslint-plugin-import/pull/1788
688689
[#1786]: https://github.com/benmosher/eslint-plugin-import/pull/1786
689690
[#1785]: https://github.com/benmosher/eslint-plugin-import/pull/1785
691+
[#1776]: https://github.com/benmosher/eslint-plugin-import/pull/1776
690692
[#1770]: https://github.com/benmosher/eslint-plugin-import/pull/1770
691693
[#1764]: https://github.com/benmosher/eslint-plugin-import/pull/1764
692694
[#1763]: https://github.com/benmosher/eslint-plugin-import/pull/1763
@@ -1180,3 +1182,4 @@ for info on changes for earlier releases.
11801182
[@julien1619]: https://github.com/julien1619
11811183
[@darkartur]: https://github.com/darkartur
11821184
[@MikeyBeLike]: https://github.com/MikeyBeLike
1185+
[@barbogast]: https://github.com/barbogast

docs/rules/no-unused-modules.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,22 @@ given file-f:
5858
```js
5959
import { e } from 'file-a'
6060
import { f } from 'file-b'
61-
import * from 'file-c'
62-
export * from 'file-d'
63-
export { default, i0 } from 'file-e' // both will be reported
61+
import * as fileC from 'file-c'
62+
export { default, i0 } from 'file-d' // both will be reported
6463

6564
export const j = 99 // will be reported
6665
```
67-
and file-e:
66+
and file-d:
6867
```js
6968
export const i0 = 9 // will not be reported
7069
export const i1 = 9 // will be reported
7170
export default () => {} // will not be reported
7271
```
73-
and file-d:
72+
and file-c:
7473
```js
7574
export const h = 8 // will not be reported
7675
export default () => {} // will be reported, as export * only considers named exports and ignores default exports
7776
```
78-
and file-c:
79-
```js
80-
export const g = 7 // will not be reported
81-
export default () => {} // will not be reported
82-
```
8377
and file-b:
8478
```js
8579
import two, { b, c, doAnything } from 'file-a'

0 commit comments

Comments
 (0)