-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nightly-only error on ImportType resolution mode assertion #49356
Merged
andrewbranch
merged 4 commits into
microsoft:main
from
andrewbranch:bug/add-nightly-only-error-on-import-type-assertion
Jun 2, 2022
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
16fa207
Add nightly-only error on ImportType resolution mode assertion
andrewbranch 40c2469
Temporarily change version to demonstrate errors
andrewbranch e158d6c
Revert "Temporarily change version to demonstrate errors"
andrewbranch da6f2a6
"Resolution mode" -> "resolution-mode"
andrewbranch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
.../baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
tests/cases/conformance/node/other.cts(3,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
tests/cases/conformance/node/other.cts(4,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
tests/cases/conformance/node/other2.cts(3,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
|
||
|
||
==== tests/cases/conformance/node/index.ts (0 errors) ==== | ||
// esm format file | ||
export {}; | ||
==== tests/cases/conformance/node/index.mts (0 errors) ==== | ||
// esm format file | ||
export {}; | ||
==== tests/cases/conformance/node/index.cts (0 errors) ==== | ||
// cjs format file | ||
export {}; | ||
==== tests/cases/conformance/node/other.ts (0 errors) ==== | ||
// esm format file | ||
export const a = await import("package/cjs"); | ||
export const b = await import("package/mjs"); | ||
export const c = await import("package"); | ||
export const f = await import("inner"); | ||
==== tests/cases/conformance/node/other2.ts (0 errors) ==== | ||
// esm format file | ||
export const d = await import("inner/cjs"); | ||
export const e = await import("inner/mjs"); | ||
==== tests/cases/conformance/node/other.mts (0 errors) ==== | ||
// esm format file | ||
export const a = await import("package/cjs"); | ||
export const b = await import("package/mjs"); | ||
export const c = await import("package"); | ||
export const f = await import("inner"); | ||
==== tests/cases/conformance/node/other2.mts (0 errors) ==== | ||
// esm format file | ||
export const d = await import("inner/cjs"); | ||
export const e = await import("inner/mjs"); | ||
==== tests/cases/conformance/node/other.cts (2 errors) ==== | ||
// cjs format file, no TLA | ||
export const a = import("package/cjs"); | ||
export const b = import("package/mjs"); | ||
~ | ||
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
export const c = import("package"); | ||
~ | ||
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
export const f = import("inner"); | ||
==== tests/cases/conformance/node/other2.cts (1 errors) ==== | ||
// cjs format file, no TLA | ||
export const d = import("inner/cjs"); | ||
export const e = import("inner/mjs"); | ||
~ | ||
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. | ||
==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== | ||
// cjs format file | ||
export const cjsMain = true; | ||
==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== | ||
// esm format file | ||
export const esm = true; | ||
==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== | ||
// cjs format file | ||
export const cjsNonmain = true; | ||
==== tests/cases/conformance/node/package.json (0 errors) ==== | ||
{ | ||
"name": "package", | ||
"private": true, | ||
"type": "module", | ||
"exports": { | ||
"./cjs": "./index.cjs", | ||
"./mjs": "./index.mjs", | ||
".": "./index.js" | ||
} | ||
} | ||
==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== | ||
{ | ||
"name": "inner", | ||
"private": true, | ||
"exports": { | ||
"./cjs": "./index.cjs", | ||
"./mjs": "./index.mjs", | ||
".": "./index.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here’s the new portability error in action. Bummer. 🥲