Skip to content

Commit 100f939

Browse files
committed
Add failing test
1 parent 15a114f commit 100f939

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/// <reference path="../fourslash.ts" />
2+
3+
// @Filename: packages/lib/package.json
4+
//// {
5+
//// "name": "lib",
6+
//// "version": "0.0.1",
7+
//// "type": "module",
8+
//// "exports": "./dist/index.js"
9+
//// }
10+
11+
// @Filename: packages/lib/tsconfig.json
12+
//// {
13+
//// "compilerOptions": {
14+
//// "composite": true,
15+
//// "module": "preserve",
16+
//// "outDir": "./dist",
17+
//// "rootDir": "./src"
18+
//// }
19+
//// }
20+
21+
// @Filename: packages/lib/src/index.ts
22+
//// export {};
23+
24+
// @Filename: packages/app/tsconfig.json
25+
//// {
26+
//// "compilerOptions": {
27+
//// "module": "nodenext"
28+
//// },
29+
//// "references": [
30+
//// { "path": "../lib" }
31+
//// ]
32+
//// }
33+
34+
// @Filename: packages/app/src/index.cts
35+
//// import {} from [|"lib"|];
36+
37+
// @link: /tests/cases/fourslash/server/packages/lib -> /tests/cases/fourslash/server/packages/app/node_modules/lib
38+
39+
goTo.file("/tests/cases/fourslash/server/packages/app/src/index.cts");
40+
verify.getSemanticDiagnostics([{
41+
code: 1479,
42+
message: `The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"lib\")' call instead.`,
43+
}]);

0 commit comments

Comments
 (0)