You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is still work in progress but I'd like to receive initial thoughts
on this implementation before I proceed.
This introduces support of dynamic imports for a rule
`no-unused-modules`.
So far only "await" form is implemented:
```js
const a = await import("a")
```
is equivalent to default import
```js
import a from "a"
```
```js
const {a,b,c} = await import("a")
```
is equivalent to named imports
```js
import {a,b,c} from "a"
```
Support import('name').then(a) and import('name').then({a,b,c}) to be
addded soon.
TODO/Open questions
- [ ] Existing code is relying on the fact that all imports/reexports
happen at top level of the file while dynamic import can happen anywhere -
that's why I had to implement visitor against visitor keys of the parser
myself not very happy about it - but couldn't figure out quickly how to
use existing visitor (if any?) supplied by a parser.
I also learned that different parsers have visitor keys defined in
different places so this has to be dealt with as well.
0 commit comments