-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed as not planned
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
🔍 Search Terms
I'm using Node.js new typescript support and have the following in my package.json`:
"imports": {
"#root/*": "./src/*"
},
In a file I'm doing the following import:
import type { QueryResolvers } from "#root/graphql/schema/types.generated.ts";
And I'm getting the following error:
This import uses a '.ts' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path.ts(2877)
As far as I know, the above import will work so there is no need for that error. It would be nice to be able to disable it.
Here's my config:
{
"compilerOptions": {
// Base Taken from https://nodejs.org/docs/latest-v23.x/api/typescript.html#type-stripping
"noEmit": true,
"target": "esnext",
"module": "nodenext",
"rewriteRelativeImportExtensions": true,
"erasableSyntaxOnly": true,
"verbatimModuleSyntax": true,
// custom:
"strict": true,
// https://stackoverflow.com/a/53957291
"noErrorTruncation": true,
"allowImportingTsExtensions": true
}
}
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
See above.
📃 Motivating Example
See above.
💻 Use Cases
See above.
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript