-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Import path not checked when not importing any symbols #20534
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
Comments
I can't find the issue because "import" + "error" = all the issues, but this is the intended behavior as per many requests from users to support scenarios such as importing CSS modules for their side effects without having to write empty declaration files for them |
So in order to support using This seems very counterintuitive. It's perfectly valid ES6 syntax to import JavaScript modules without importing any symbols in order to ensure (say) global dependencies or other bootstrapping is resolved; I would think allowing importing things that aren't actually code should be the exception rather than the rule and have some special handling if needed. This should at the very least be a user-configurable compilation option. And even if we decide we aren't going to typecheck the static dependency (e.g. since it's CSS), we should still at least ensure it exists! But ideally, we'd ensure ALL import targets exist, and ones that are actually typescript (or javascript if using |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Uh oh!
There was an error while loading. Please reload this page.
Typescript version: 2.6.1
Code
Expected behavior:
Import statements that don't import any symbols should be checked the same as any other.
Actual behavior:
If you don't import a symbol, the import target is not validated to resolve correctly.
tsconfig.json:
The text was updated successfully, but these errors were encountered: