Closed
Description
π Search Terms
noUncheckedSideEffectImports
π Version & Regression Information
- This changed between versions 5.5.* and 5.6.*
- This changed in commit or PR - Add new option "noUncheckedSideEffectImports"Β #58941
β― Playground Link
https://stackblitz.com/edit/vitejs-vite-v2boec?file=src%2Fmain.ts
π» Code
import 'does-not-exist.css';
π Actual behavior
With the noUncheckedSideEffectImports
ts compiler flag on, the error is not thrown for the non-existing .css
file reference (side effect import) when executing tsc
. Actually, it is not thrown for any file extension other than js
.
π Expected behavior
As stated here, the error should be thrown for non-existing css
file/module reference.
Additional information about the issue
Steps to reproduce:
- Visit the playgound typescript project
- Expect the runtime error (because of the non-existing file reference in the code)
main.ts
- notice the side effect import of non-existing CSS fileglobals.d.ts
- notice the file and its contents (as described HERE)- Open new stackblitz terminal
- Execute the following:
npm run check
- Observe a result
Expected result: tsc
throws an error for the non-existing file reference
Actual result: Specifically, the tsc
successfully finishes with no errors. In general, tsc
doesn't throw no matter the file extension, EXCEPT for the .js