Closed
Description
Bug Report
π Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about this.
β― Playground Link
Playground link with relevant code
π» Code
// @module: Node16
import "./file";
π Actual behavior
TypeScript says nothing.
π Expected behavior
I want TypeScript to tell me that .js
is missing, the same way it does in any other type of import. I think I understand why it doesn't right now, because side effects have nothing to do with static analysis, so the incorrectness of the import doesn't prevent TypeScript from doing its job in any way, but:
- I haven't been able to set this up in the bug workbench, but what happens if the file is being imported from
node_modules
and has a corresponding.d.ts
with adeclare ...
in it? Will thatdeclare
get applied? - Wouldn't this be useful to have either way? I guess ESLint could fill this void, but seeing how
eslint-plugin-import
is dragging its feet onimport/extensions
, there's little hope for that.
Apologies if this has been addressed before, couldn't find.