-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Ensure harness doesn't force or eagerly computes target
, stop using raw target
elsewhere
#57526
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ import { | |
GetAccessorDeclaration, | ||
getEffectiveReturnTypeNode, | ||
getEffectiveTypeAnnotationNode, | ||
getEmitScriptTarget, | ||
getLanguageVariant, | ||
getLeadingCommentRanges, | ||
getNameOfDeclaration, | ||
|
@@ -350,7 +351,7 @@ export function provideInlayHints(context: InlayHintsContext): InlayHint[] { | |
} | ||
|
||
function leadingCommentsContainsParameterName(node: Node, name: string) { | ||
if (!isIdentifierText(name, compilerOptions.target, getLanguageVariant(file.scriptKind))) { | ||
if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions), getLanguageVariant(file.scriptKind))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems quite easy to make this kind of error; I am tempted to write an eslint rule which disallows the use of any CompilerOption property that we know to be computed, but that is non-trivial. |
||
return false; | ||
} | ||
|
||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
error TS2468: Cannot find global value 'Promise'. | ||
/src/buzz.mts(2,1): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. | ||
/src/buzz.mts(2,8): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. | ||
|
||
|
||
!!! error TS2468: Cannot find global value 'Promise'. | ||
==== /src/buzz.mts (2 errors) ==== | ||
==== /src/buzz.mts (1 errors) ==== | ||
// Extensionless relative path dynamic import in an ES module | ||
import("./foo").then(x => x); // should error, ask for extension | ||
~~~~~~~~~~~~~~~ | ||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. | ||
~~~~~~~ | ||
!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
error TS2468: Cannot find global value 'Promise'. | ||
/src/bar.cts(2,1): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another example of the implicit module setting now being reflected in tests; this was defaulted to ES5, but now it's esnext. |
||
/src/bar.cts(2,8): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. | ||
|
||
|
||
!!! error TS2468: Cannot find global value 'Promise'. | ||
==== /src/bar.cts (2 errors) ==== | ||
==== /src/bar.cts (1 errors) ==== | ||
// Extensionless relative path dynamic import in a cjs module | ||
import("./foo").then(x => x); // should error, ask for extension | ||
~~~~~~~~~~~~~~~ | ||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. | ||
~~~~~~~ | ||
!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. |
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.
I want to say that we should drop these too, but:
newLine
, all baselines will change from CRLF to LF and lose git history.skipDefaultLibCheck
is a perf optimization.noErrorTruncation
gives us better baselines.