-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tests] no-unresolved
: add tests for import()
#2012
Conversation
no-unresolved
Check dynamic imports when using the built-in Eslint parserno-unresolved
: Check dynamic imports when using the built-in Eslint parser
Thanks, the fix seems great. This is blocked for now on #1986, unfortunately. |
2448a96
to
3c5e2c8
Compare
1fa34fb
to
834921a
Compare
@@ -85,7 +92,7 @@ function runResolverTests(resolver) { | |||
options: [{ commonjs: true }] }), | |||
], | |||
|
|||
invalid: [ | |||
invalid: [].concat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious why the [].concat()
is needed. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because RuleTester requires an array of objects, so there's no way to conditionally provide an ignoreable value, so we have to use [].concat()
and have the conditional helper return an empty array, since concat flatMaps over arrays.
5837636
to
14acb5b
Compare
@davidbonnet tests still seem to be failing here, so i think this one needs a bit more investigation. @aladdin-add if your PR can get the tests passing, that'd be great too. |
14acb5b
to
dd7d3a6
Compare
no-unresolved
: Check dynamic imports when using the built-in Eslint parserno-unresolved
: add tests for import()
9d4a107
to
ad2a619
Compare
Dynamic imports landed in EcmaScript 2020, and Eslint now parses it out of the box.
However, the AST
node
containing the dynamic import is anImportExpression
, which is ignored by theno-unresolved
rule.