[import()] Adding support to lint dynamic imports (babel/babel-eslint#413)

* [import()] Adding support to lint dynamic imports

* [import()] Adding regression test to import
This commit is contained in:
Jordan Gensler
2016-10-17 14:40:06 -04:00
parent 1f04cab99f
commit 1d52247080
2 changed files with 10 additions and 1 deletions

View File

@@ -383,7 +383,8 @@ exports.parseNoPatch = function (code, options) {
"functionBind",
"functionSent",
"objectRestSpread",
"trailingFunctionCommas"
"trailingFunctionCommas",
"dynamicImport"
]
};

View File

@@ -1601,6 +1601,14 @@ describe("verify", function () {
});
});
it("dynamic import support", function () {
verifyAndAssertMessages(
"import('test-module').then(() => {})",
{},
[]
);
});
// it("regex with es6 unicodeCodePointEscapes", function () {
// verifyAndAssertMessages(
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",