TypeScript/tests/baselines/reference/moduleResolutionWithoutExtension8.types
Gabriela Araujo Britto 9cdbb7248b
Improve errors on module: node12 and extensionless relative imports (#46486)
* add new error + suggestions

* push down assert defined

* remove comment

* fix esm module import detection, update baselines

* add and update new tests

* fix review comments

* remove renamed baseline references

* update node modules test baselines

* fix error message, add new tests

* update old tests with new error message
2021-10-29 10:25:03 -07:00

13 lines
723 B
Plaintext

=== /src/bar.cts ===
// Extensionless relative path dynamic import in a cjs module
import("./foo").then(x => x); // should error, ask for extension
>import("./foo").then(x => x) : Promise<any>
>import("./foo").then : <TResult1 = any, TResult2 = never>(onfulfilled?: (value: any) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
>import("./foo") : Promise<any>
>"./foo" : "./foo"
>then : <TResult1 = any, TResult2 = never>(onfulfilled?: (value: any) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
>x => x : (x: any) => any
>x : any
>x : any