Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 41b9542

Browse files
kesnehzoo
authored andcommitted
[import()] Adding support to lint dynamic imports (#413)
* [import()] Adding support to lint dynamic imports * [import()] Adding regression test to import
1 parent 88e39ad commit 41b9542

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ exports.parseNoPatch = function (code, options) {
383383
"functionBind",
384384
"functionSent",
385385
"objectRestSpread",
386-
"trailingFunctionCommas"
386+
"trailingFunctionCommas",
387+
"dynamicImport"
387388
]
388389
};
389390

test/non-regression.js

+8
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,14 @@ describe("verify", function () {
16011601
});
16021602
});
16031603

1604+
it("dynamic import support", function () {
1605+
verifyAndAssertMessages(
1606+
"import('test-module').then(() => {})",
1607+
{},
1608+
[]
1609+
);
1610+
});
1611+
16041612
// it("regex with es6 unicodeCodePointEscapes", function () {
16051613
// verifyAndAssertMessages(
16061614
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",

0 commit comments

Comments
 (0)