Skip to content

Commit

Permalink
[import()] Adding support to lint dynamic imports (babel/babel-eslint…
Browse files Browse the repository at this point in the history
…#413)

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

* [import()] Adding regression test to import
  • Loading branch information
kesne committed Oct 17, 2016
1 parent 1f04cab commit 1d52247
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eslint/babel-eslint-parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ exports.parseNoPatch = function (code, options) {
"functionBind",
"functionSent",
"objectRestSpread",
"trailingFunctionCommas"
"trailingFunctionCommas",
"dynamicImport"
]
};

Expand Down
8 changes: 8 additions & 0 deletions eslint/babel-eslint-parser/test/non-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)};`);",
Expand Down

0 comments on commit 1d52247

Please sign in to comment.