
[microsoft/TypeScript] Design Meeting Notes, 9/9/2025 (Issue #62583)
DRANK
DanielRosenwasser created an issue (microsoft/TypeScript#62583) # `noUncheckedSideEffectImports` by default https://github.com/Microsoft/TypeScript/issues/62421 * \[\[*Funny aside - presenter wrote `import whoops from "whoops"` as an example in the TypeScript playground expecting an error, but gets none because a package named `whoops` actually exists on npm and we fetched its types.*]] * You can write `import * as blah from "./something-that-doesnt-exist-i-swear.css`, you will get an error. * But if you write `import "./something-that-doesnt-exist-i-swear.css`, you will get no error. * We added `--noUncheckedSideEffectImports` to catch this, but its default is `false`. * For users who want it on but for certain things to work (e.g. importing `.css` files), they either need * `declare module "*.css"` at the top level of (a non-module) `.d.ts` file. * write a `.d.css.ts` file per CSS file. * Users can also always `// @ts-ignore`. * If we want it for 6.0, do this immediately on 7.0. * The reason we didn't add the error initially was because we didn't have pattern ambient modules like `*.filetype`. * Would like to special-case the error message. * Pattern ambient modules are the least safe way to declare this, which is unfortunate. Sort of defeats the purpose. # Enable `--allowImportingTsExtensions` by default https://github.com/microsoft/TypeScript/issues/62342 * Most server-side runtimes + bundlers support `.ts` imports. * Want people to just be able to run `.ts` files with no extra flag/ * `--allowImportingTsExtensions` is off by default. * Requires `--noEmit` though. * There's also `--rewriteRelativeImportExtensions` which is off by default, but wouldn't you actually want this more? * So much of this really needs to be informed by whether you have `--noEmit`. * We don't want to make this behavior dependent on more flags. * Maybe a good first step is to turn `allowImportingTsExtensions` on in the default editor config. * `rewriteRelativeImportExtensions` being on depending on `outDir` seems tempting. * "no it isn't!" * A lot of this is really dependent on the target system. * This kind of relies on if you're an app author or library author? * App authors don't care, will likely always run directly from source. * Library authors care because they must emit; they can't ship `.ts` files. * But can't make `rewriteRelativeImportExtensions` on by default because no default `outDir`. * Wait, that's not a problem. That's why `allowJs` must be off by default. * `esnext` is a weird target for this. * `nodenext`? * `bundler`? * Makes sense under these. * We should be able to make things "just work" to run `.ts` files in an editor. * Sure, but what happens as soon as you add a `tsconfig.json`? * We can fix this in the editor - what about type-checking? -- Reply to this email directly or view it on GitHub: https://github.com/microsoft/TypeScript/issues/62583 You are receiving this because you are subscribed to this thread. Message ID: <microsoft/TypeScript/issues/62583@github.com>
👀👀😄👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀github.com/microsoft/Type…t.co/dVKLPt9txL