Skip to content

Commit 308b60e

Browse files
authored
Merge branch 'main' into issue2385
2 parents 126d094 + 21304bd commit 308b60e

File tree

11 files changed

+41
-7
lines changed

11 files changed

+41
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1515
- [`default`]: `typescript-eslint-parser`: avoid a crash on exporting as namespace (thanks [@ljharb])
1616
- [`export`]/TypeScript: false positive for typescript namespace merging ([#1964], thanks [@magarcia])
1717
- [`no-duplicates`]: ignore duplicate modules in different TypeScript module declarations ([#2378], thanks [@remcohaszing])
18+
- [`no-unused-modules`]: avoid a crash when processing re-exports ([#2388], thanks [@ljharb])
1819

1920
### Changed
2021
- [Tests] `no-nodejs-modules`: add tests for node protocol URL ([#2367], thanks [@sosukesuzuki])
2122
- [Tests] `default`, `no-anonymous-default-export`, `no-mutable-exports`, `no-named-as-default-member`, `no-named-as-default`: add tests for arbitrary module namespace names ([#2358], thanks [@sosukesuzuki])
2223
- [Docs] [`no-unresolved`]: Fix RegExp escaping in readme ([#2332], thanks [@stephtr])
2324
- [Refactor] `namespace`: try to improve performance ([#2340], thanks [@ljharb])
25+
- [Docs] make rule doc titles consistent ([#2393], thanks [@TheJaredWilcurt])
2426

2527
## [2.25.4] - 2022-01-02
2628

@@ -971,6 +973,8 @@ for info on changes for earlier releases.
971973

972974
[`memo-parser`]: ./memo-parser/README.md
973975

976+
[#2393]: https://github.com/import-js/eslint-plugin-import/pull/2393
977+
[#2388]: https://github.com/import-js/eslint-plugin-import/pull/2388
974978
[#2381]: https://github.com/import-js/eslint-plugin-import/pull/2381
975979
[#2378]: https://github.com/import-js/eslint-plugin-import/pull/2378
976980
[#2371]: https://github.com/import-js/eslint-plugin-import/pull/2371
@@ -1659,6 +1663,7 @@ for info on changes for earlier releases.
16591663
[@Taranys]: https://github.com/Taranys
16601664
[@taye]: https://github.com/taye
16611665
[@TheCrueltySage]: https://github.com/TheCrueltySage
1666+
[@TheJaredWilcurt]: https://github.com/TheJaredWilcurt
16621667
[@tihonove]: https://github.com/tihonove
16631668
[@timkraut]: https://github.com/timkraut
16641669
[@tizmagik]: https://github.com/tizmagik

docs/rules/dynamic-import-chunkname.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# dynamic imports require a leading comment with a webpackChunkName (dynamic-import-chunkname)
1+
# import/dynamic-import-chunkname
22

33
This rule reports any dynamic imports without a webpackChunkName specified in a leading block comment in the proper format.
44

docs/rules/imports-first.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# imports-first
1+
# import/imports-first
22

33
This rule was **deprecated** in eslint-plugin-import v2.0.0. Please use the corresponding rule [`first`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/first.md).

docs/rules/no-import-module-exports.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# no-import-module-exports
1+
# import/no-import-module-exports
22

33
Reports the use of import declarations with CommonJS exports in any module
44
except for the [main module](https://docs.npmjs.com/files/package.json#main).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@
111111
"minimatch": "^3.1.2",
112112
"object.values": "^1.1.5",
113113
"resolve": "^1.22.0",
114-
"tsconfig-paths": "^3.12.0"
114+
"tsconfig-paths": "^3.13.0"
115115
}
116116
}

src/rules/no-unused-modules.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ const prepareImportsAndExports = (srcFiles, context) => {
273273
exportAll.forEach((value, key) => {
274274
value.forEach(val => {
275275
const currentExports = exportList.get(val);
276-
const currentExport = currentExports.get(EXPORT_ALL_DECLARATION);
277-
currentExport.whereUsed.add(key);
276+
if (currentExports) {
277+
const currentExport = currentExports.get(EXPORT_ALL_DECLARATION);
278+
currentExport.whereUsed.add(key);
279+
}
278280
});
279281
});
280282
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { hello } from './magic/test'
2+
3+
hello();
4+
5+
export default function App() {};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import App from './App';
2+
3+
export const x = App
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './test'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function hello() {
2+
console.log('hello!!');
3+
}
4+
5+
export function unused() {
6+
console.log('im unused!!');
7+
}

0 commit comments

Comments
 (0)