mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
a311dd9b63
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: andrewbranch <[email protected]> Co-authored-by: Andrew Branch <[email protected]>
39 lines
939 B
TypeScript
39 lines
939 B
TypeScript
// @noEmit: true
|
|
// @noTypesAndSymbols: true
|
|
// @module: nodenext
|
|
// @moduleResolution: nodenext
|
|
// Test verifies that when a module specifier contains ".ts" that gets matched by a
|
|
// wildcard pattern, resolvedUsingTsExtension is correctly set to true.
|
|
// Example: import "#/foo.ts.omg" with pattern "#/*.omg": "./src/*"
|
|
// The * matches "foo.ts", and when expanded becomes "./src/foo.ts"
|
|
// Since the wildcard matched ".ts" from the specifier, an error should be reported.
|
|
|
|
// @filename: src/foo.ts
|
|
export function hello() {
|
|
return "world";
|
|
}
|
|
|
|
// @filename: src/index.ts
|
|
import { hello } from "#/foo.ts.omg";
|
|
|
|
hello();
|
|
|
|
// @filename: package.json
|
|
{
|
|
"type": "module",
|
|
"imports": {
|
|
"#/*.omg": "./src/*"
|
|
}
|
|
}
|
|
|
|
// @filename: tsconfig.json
|
|
{
|
|
"compilerOptions": {
|
|
"module": "nodenext",
|
|
"moduleResolution": "nodenext",
|
|
"rootDir": "src",
|
|
"outDir": "dist"
|
|
},
|
|
"include": ["src"]
|
|
}
|