mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 00:36:29 -05:00
Update error messages for CJS imports resolving to ES modules (#50088)
* Update error messages for CJS imports resolving to ES modules * Update error message * Use package scope from source file * Update baselines * Issue error for JSX/TSX files * Switch from related info to message chain
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// @noEmit: true
|
||||
// @noTypesAndSymbols: true
|
||||
// @module: node16
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @jsx: preserve
|
||||
|
||||
// @Filename: /package.json
|
||||
{}
|
||||
|
||||
// @Filename: /module.mts
|
||||
export {};
|
||||
|
||||
// @Filename: /tsExtension.ts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /jsExtension.js
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /ctsExtension.cts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /tsxExtension.tsx
|
||||
import {} from "./module.mjs";
|
||||
@@ -0,0 +1,24 @@
|
||||
// @noEmit: true
|
||||
// @noTypesAndSymbols: true
|
||||
// @module: node16
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @jsx: preserve
|
||||
|
||||
// @Filename: /package.json
|
||||
{ "type": "commonjs" }
|
||||
|
||||
// @Filename: /module.mts
|
||||
export {};
|
||||
|
||||
// @Filename: /tsExtension.ts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /jsExtension.js
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /ctsExtension.cts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /tsxExtension.tsx
|
||||
import {} from "./module.mjs";
|
||||
@@ -0,0 +1,24 @@
|
||||
// @noEmit: true
|
||||
// @noTypesAndSymbols: true
|
||||
// @module: node16
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @jsx: preserve
|
||||
|
||||
// @Filename: /package.json
|
||||
{ "type": "module" }
|
||||
|
||||
// @Filename: /module.mts
|
||||
export {};
|
||||
|
||||
// @Filename: /tsExtension.ts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /jsExtension.js
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /ctsExtension.cts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /tsxExtension.tsx
|
||||
import {} from "./module.mjs";
|
||||
@@ -0,0 +1,21 @@
|
||||
// @noEmit: true
|
||||
// @noTypesAndSymbols: true
|
||||
// @module: node16
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @jsx: preserve
|
||||
|
||||
// @Filename: /module.mts
|
||||
export {};
|
||||
|
||||
// @Filename: /tsExtension.ts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /jsExtension.js
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /ctsExtension.cts
|
||||
import {} from "./module.mjs";
|
||||
|
||||
// @Filename: /tsxExtension.tsx
|
||||
import {} from "./module.mjs";
|
||||
Reference in New Issue
Block a user