Skip to content
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

Lint Dynamic Imports for no-unresolved #1035

Closed
tgreen7 opened this issue Mar 3, 2018 · 4 comments · Fixed by #1218
Closed

Lint Dynamic Imports for no-unresolved #1035

tgreen7 opened this issue Mar 3, 2018 · 4 comments · Fixed by #1218

Comments

@tgreen7
Copy link

tgreen7 commented Mar 3, 2018

For code-splitting in our app we have

import(/* webpackChunkName: "WelcomePage" */ "./components/WelcomePage")

However, we don't get the same awesome eslint error if that path doesn't exist. It would be great to have that linted as well.

@ljharb
Copy link
Member

ljharb commented Mar 3, 2018

Seems reasonable, altho it would require using babel-eslint.

@ljharb
Copy link
Member

ljharb commented Mar 3, 2018

Actually tho - import() uses urls, not paths, so I’m not sure how this would work properly.

@vikr01
Copy link
Contributor

vikr01 commented Aug 28, 2018

import() uses urls, not paths

Doesn't it use paths and webpack transforms them into urls?

I've also noticed that import/resolve doesn't work on require.* statements (i.e. require.resolve and require.ensure). This would be a really neat feature to have.

@ljharb
Copy link
Member

ljharb commented Aug 28, 2018

require.ensure is nonstandard webpack nonsense, but require.resolve would make some sense.

ljharb pushed a commit to vikr01/eslint-plugin-import that referenced this issue Apr 12, 2019
 - fix import() to work with no-cycle
 - add tests using multiple imports in no-cycle

Fixes import-js#1035. Fixes import-js#1166.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants