Skip to content

Commit 87f4735

Browse files
authored
Merge branch 'import-js:main' into contrib-sort-types-among-themselves
2 parents 2cf2a68 + 8b2d570 commit 87f4735

File tree

7 files changed

+17
-1
lines changed

7 files changed

+17
-1
lines changed

tests/files/minified/no-newline.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function y() {
2+
console.log("y");
3+
}export {y};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function a(){console.log('foo')}export{a as foo};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function a(){return true}export{a};

tests/files/minified/one-line.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function a(){console.log("foo")};export{a};

tests/src/core/getExports.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ describe('ExportMap', function () {
465465
['bar.js', true],
466466
['deep-es7/b.js', true],
467467
['common.js', false],
468+
['./minified/no-newline.js', true],
469+
['./minified/one-line-no-semi-renamed.js', true],
470+
['./minified/one-line-no-semi.js', true],
471+
['./minified/one-line.js', true],
468472
];
469473

470474
for (const [testFile, expectedRegexResult] of testFiles) {

utils/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
55

66
## Unreleased
77

8+
### Fixed
9+
- `unambiguous`: detect modules exported from minified code ([#3124], thanks [@michaelfaith])
10+
811
### Changed
912
- [refactor] `parse`: avoid using a regex here (thanks [@ljharb])
1013

@@ -180,6 +183,7 @@ Yanked due to critical issue with cache key resulting from #839.
180183
### Fixed
181184
- `unambiguous.test()` regex is now properly in multiline mode
182185

186+
[#3124]: https://github.com/import-js/eslint-plugin-import/pull/3124
183187
[#3072]: https://github.com/import-js/eslint-plugin-import/pull/3072
184188
[#3061]: https://github.com/import-js/eslint-plugin-import/pull/3061
185189
[#3057]: https://github.com/import-js/eslint-plugin-import/pull/3057
@@ -230,6 +234,7 @@ Yanked due to critical issue with cache key resulting from #839.
230234
[@JounQin]: https://github.com/JounQin
231235
[@kaiyoma]: https://github.com/kaiyoma
232236
[@leipert]: https://github.com/leipert
237+
[@ljharb]: https://github.com/ljharb
233238
[@manuth]: https://github.com/manuth
234239
[@maxkomarychev]: https://github.com/maxkomarychev
235240
[@mgwalker]: https://github.com/mgwalker
@@ -238,6 +243,7 @@ Yanked due to critical issue with cache key resulting from #839.
238243
[@nicolo-ribaudo]: https://github.com/nicolo-ribaudo
239244
[@pmcelhaney]: https://github.com/pmcelhaney
240245
[@sergei-startsev]: https://github.com/sergei-startsev
246+
[@silverwind]: https://github.com/silverwind
241247
[@sompylasar]: https://github.com/sompylasar
242248
[@timkraut]: https://github.com/timkraut
243249
[@vikr01]: https://github.com/vikr01

utils/unambiguous.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports.__esModule = true;
44

5-
const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m;
5+
const pattern = /(^|[;})])\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m;
66
/**
77
* detect possible imports/exports without a full parse.
88
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy