586b0d5011
* Initial support for module: node12 * Add allowJs and declaration emit enabled tests * Fix typos * cts, mts, cjs, mjs, etc extension support * Fix watch of files whose intepretation changes due to a package.json update * Minor PR feedback * Adjust error message * Initial import/export/self-name support * Accept new error codes * TypesVersions support in export/import map conditions * Fix import suggestion and autoimport default extensions under new resolution modes * Add tests for import maps non-relative name lookup feature * Fix isDeclarationFileName for .d.mts and .d.cts * Preserve new extensions when generating module specifiers * Fix spurious implict any suggestion caused by file ordering bug and optimize import name format detection by relying on parents being set * Fix a bunch of incremental bugs that dont repro under fourslash for some reason * Accept updated baseline * Always include extensions on completions for cjs/mjs style imports * String completion relative import suggestions respect the mode of the import when choosing if they provide extensions * Style feedback * Change diagnostic case
202 lines
5.4 KiB
Plaintext
202 lines
5.4 KiB
Plaintext
=== tests/cases/conformance/node/index.ts ===
|
|
// esm format file
|
|
import * as cjs from "package/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.ts, 1, 6))
|
|
|
|
import * as mjs from "package/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.ts, 2, 6))
|
|
|
|
import * as type from "package";
|
|
>type : Symbol(type, Decl(index.ts, 3, 6))
|
|
|
|
export const a = cjs;
|
|
>a : Symbol(type.a, Decl(index.ts, 4, 12))
|
|
>cjs : Symbol(cjs, Decl(index.ts, 1, 6))
|
|
|
|
export const b = mjs;
|
|
>b : Symbol(type.b, Decl(index.ts, 5, 12))
|
|
>mjs : Symbol(mjs, Decl(index.ts, 2, 6))
|
|
|
|
export const c = type;
|
|
>c : Symbol(type.c, Decl(index.ts, 6, 12))
|
|
>type : Symbol(type, Decl(index.ts, 3, 6))
|
|
|
|
import * as cjsi from "inner/cjs";
|
|
>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6))
|
|
|
|
import * as mjsi from "inner/mjs";
|
|
>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6))
|
|
|
|
import * as typei from "inner";
|
|
>typei : Symbol(typei, Decl(index.ts, 9, 6))
|
|
|
|
export const d = cjsi;
|
|
>d : Symbol(type.d, Decl(index.ts, 10, 12))
|
|
>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6))
|
|
|
|
export const e = mjsi;
|
|
>e : Symbol(type.e, Decl(index.ts, 11, 12))
|
|
>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6))
|
|
|
|
export const f = typei;
|
|
>f : Symbol(type.f, Decl(index.ts, 12, 12))
|
|
>typei : Symbol(typei, Decl(index.ts, 9, 6))
|
|
|
|
=== tests/cases/conformance/node/index.mts ===
|
|
// esm format file
|
|
import * as cjs from "package/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.mts, 1, 6))
|
|
|
|
import * as mjs from "package/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.mts, 2, 6))
|
|
|
|
import * as type from "package";
|
|
>type : Symbol(type, Decl(index.mts, 3, 6))
|
|
|
|
export const a = cjs;
|
|
>a : Symbol(mjs.a, Decl(index.mts, 4, 12))
|
|
>cjs : Symbol(cjs, Decl(index.mts, 1, 6))
|
|
|
|
export const b = mjs;
|
|
>b : Symbol(mjs.b, Decl(index.mts, 5, 12))
|
|
>mjs : Symbol(mjs, Decl(index.mts, 2, 6))
|
|
|
|
export const c = type;
|
|
>c : Symbol(mjs.c, Decl(index.mts, 6, 12))
|
|
>type : Symbol(type, Decl(index.mts, 3, 6))
|
|
|
|
import * as cjsi from "inner/cjs";
|
|
>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6))
|
|
|
|
import * as mjsi from "inner/mjs";
|
|
>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6))
|
|
|
|
import * as typei from "inner";
|
|
>typei : Symbol(typei, Decl(index.mts, 9, 6))
|
|
|
|
export const d = cjsi;
|
|
>d : Symbol(mjs.d, Decl(index.mts, 10, 12))
|
|
>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6))
|
|
|
|
export const e = mjsi;
|
|
>e : Symbol(mjs.e, Decl(index.mts, 11, 12))
|
|
>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6))
|
|
|
|
export const f = typei;
|
|
>f : Symbol(mjs.f, Decl(index.mts, 12, 12))
|
|
>typei : Symbol(typei, Decl(index.mts, 9, 6))
|
|
|
|
=== tests/cases/conformance/node/index.cts ===
|
|
// cjs format file
|
|
import * as cjs from "package/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.cts, 1, 6))
|
|
|
|
import * as mjs from "package/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.cts, 2, 6))
|
|
|
|
import * as type from "package";
|
|
>type : Symbol(type, Decl(index.cts, 3, 6))
|
|
|
|
export const a = cjs;
|
|
>a : Symbol(cjs.a, Decl(index.cts, 4, 12))
|
|
>cjs : Symbol(cjs, Decl(index.cts, 1, 6))
|
|
|
|
export const b = mjs;
|
|
>b : Symbol(cjs.b, Decl(index.cts, 5, 12))
|
|
>mjs : Symbol(mjs, Decl(index.cts, 2, 6))
|
|
|
|
export const c = type;
|
|
>c : Symbol(cjs.c, Decl(index.cts, 6, 12))
|
|
>type : Symbol(type, Decl(index.cts, 3, 6))
|
|
|
|
import * as cjsi from "inner/cjs";
|
|
>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6))
|
|
|
|
import * as mjsi from "inner/mjs";
|
|
>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6))
|
|
|
|
import * as typei from "inner";
|
|
>typei : Symbol(typei, Decl(index.cts, 9, 6))
|
|
|
|
export const d = cjsi;
|
|
>d : Symbol(cjs.d, Decl(index.cts, 10, 12))
|
|
>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6))
|
|
|
|
export const e = mjsi;
|
|
>e : Symbol(cjs.e, Decl(index.cts, 11, 12))
|
|
>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6))
|
|
|
|
export const f = typei;
|
|
>f : Symbol(cjs.f, Decl(index.cts, 12, 12))
|
|
>typei : Symbol(typei, Decl(index.cts, 9, 6))
|
|
|
|
=== tests/cases/conformance/node/node_modules/inner/index.d.ts ===
|
|
// cjs format file
|
|
import * as cjs from "inner/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6))
|
|
|
|
import * as mjs from "inner/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6))
|
|
|
|
import * as type from "inner";
|
|
>type : Symbol(type, Decl(index.d.ts, 3, 6))
|
|
|
|
cjs;
|
|
>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6))
|
|
|
|
mjs;
|
|
>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6))
|
|
|
|
type;
|
|
>type : Symbol(type, Decl(index.d.ts, 3, 6))
|
|
|
|
export const cjsMain = true;
|
|
>cjsMain : Symbol(type.cjsMain, Decl(index.d.ts, 7, 12))
|
|
|
|
=== tests/cases/conformance/node/node_modules/inner/index.d.mts ===
|
|
// esm format file
|
|
import * as cjs from "inner/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6))
|
|
|
|
import * as mjs from "inner/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6))
|
|
|
|
import * as type from "inner";
|
|
>type : Symbol(type, Decl(index.d.mts, 3, 6))
|
|
|
|
cjs;
|
|
>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6))
|
|
|
|
mjs;
|
|
>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6))
|
|
|
|
type;
|
|
>type : Symbol(type, Decl(index.d.mts, 3, 6))
|
|
|
|
export const esm = true;
|
|
>esm : Symbol(mjs.esm, Decl(index.d.mts, 7, 12))
|
|
|
|
=== tests/cases/conformance/node/node_modules/inner/index.d.cts ===
|
|
// cjs format file
|
|
import * as cjs from "inner/cjs";
|
|
>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6))
|
|
|
|
import * as mjs from "inner/mjs";
|
|
>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6))
|
|
|
|
import * as type from "inner";
|
|
>type : Symbol(type, Decl(index.d.cts, 3, 6))
|
|
|
|
cjs;
|
|
>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6))
|
|
|
|
mjs;
|
|
>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6))
|
|
|
|
type;
|
|
>type : Symbol(type, Decl(index.d.cts, 3, 6))
|
|
|
|
export const cjsNonmain = true;
|
|
>cjsNonmain : Symbol(cjs.cjsNonmain, Decl(index.d.cts, 7, 12))
|
|
|