-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix: diagnostic message for class name 'Object' when targeting different ECMAScript versions #61358
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
ba928e6
fix: diagnostic message for class name 'Object' when targeting differ…
idango10 aa9b991
fix failing tests
idango10 852d6f4
fix format issue
idango10 1efdcd9
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs 0aac720
Bump github/codeql-action from 3.28.10 to 3.28.11 in the github-actio…
dependabot[bot] a00b324
Fix serialization of accessor types in declaration files. (#61392)
dragomirtitian ee3dd72
fix(60908): Unexpected "'Type' is declared but its value is never rea…
a-tarasyuk 4dc677b
Fix errors on type assertions in erasableSyntaxOnly (#61452)
DanielRosenwasser 19b7772
Bump the github-actions group with 4 updates (#61474)
dependabot[bot] 29e6d66
Fix `lib.includes('dom')` check in `containerSeemsToBeEmptyDomElement…
frodi-karlsson c7a559e
Add new release publisher yaml (#61491)
jakebailey 7b26d2e
Fix incorrect name in new release pipeline (#61514)
jakebailey 89c572c
Fixed a symbol display crash on expando members write locations (#55478)
Andarist 7205eda
Bump github/codeql-action from 3.28.12 to 3.28.13 in the github-actio…
dependabot[bot] ba663f6
Exclude completions of binding pattern variable initializers (#52723)
zardoy 83dc0bb
Convert release publishing inputs into parameters (#61523)
jakebailey eef7c14
Treat functions with `@type` tags on parameters as typed in JS files …
Andarist 069de74
Expandable hover (#61492)
gabritto 6afd0fb
Fix crash when serializing default export in error (#61582)
andrewbranch 0a1aa6d
Deemphasize old JSX transform (#61586)
eps1lon 62b172b
Bump the github-actions group across 1 directory with 3 updates (#61601)
dependabot[bot] 75202af
Fix #61098 (#61113)
HansBrende 38b78b7
Add the `.getNonPrimitiveType()` method to the `TypeChecker` (#61562)
mrazauskas 11e7932
fix(61258): Renaming namespace with const enum doesn't update enum re…
a-tarasyuk e37ca49
`arguments` should not be allowed in class static block (#48172)
Zzzen 5e36778
check usage before declaration for decorators (#50372)
Zzzen d88d3a4
docs(lib): add @throws JSDoc for JSON methods (#61596)
Joseph-Martre 8c62e08
DOM Update 2025-05-02 (#61647)
rbuckton 0ee67b5
Add configurable maximum hover length (#61662)
gabritto 7156300
Fix unwanted constant comparisons potentially causing bugs (#61655)
ulrichstark 0fb5e3a
Preserve type parameter constraint in emitted mapped types while pres…
Andarist b86ab7d
Stop reassigning `.valueDeclaration` to avoid replacing earlier decla…
Andarist 81c9518
Fix getResolvePackageJsonImports utility (#61707)
andrewbranch b504a1e
Handle lock file 3 version when caching the typings ensuring we can r…
sheetalkamat 44d4671
Update pr_owners.txt (#61798)
jakebailey 3dd0a35
Initialize the map for dts to reference and source to reference when …
sheetalkamat 2b88aeb
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs a591ca3
fix(61747): for (using of = is incorrectly parsed (#61764)
a-tarasyuk ac03ba4
fix(checker): report error when using bigint as enum key (#61777)
magic-akari cd34199
tsc --init update (#61813)
RyanCavanaugh a69c6d0
Add support for `import defer` proposal (#60757)
nicolo-ribaudo ffd98c1
feat: add Error.isError() to ESNext lib (#60788)
dirkluijk 51dcd90
Cache mapper instantiations (#61505)
Andarist 652ed7f
Add lib.esnext.sharedmemory (#61646)
Renegade334 1e24945
explicitly disallow `using` in ambient contexts (#61781)
Renegade334 fa2a0fc
Issue "'{0}' declarations can only be declared inside a block." for b…
Andarist 7715955
Fix helpers emit for .cjs files in ESM module mode (#61814)
andrewbranch 355b9e0
Avoid resolving source prop type when the target is `unknown`/`any` (…
Andarist 97cfa26
optimization, reduce memory usage (#61822)
VincentBailly cb38d99
Add `--module node20` (#61805)
andrewbranch 34d1ea6
Fix type variable leaks and cache inconsistencies (#61668)
ahejlsberg 0dfd0c2
Restore `import defer =` parsing (#61837)
nicolo-ribaudo 12e09f4
Port "Improve type discrimination algorithm" from tsgo (#61828)
jakebailey 529ed09
fix link to "Help Wanted" issues (#61843)
AllenSH12 dd1e258
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs f0df536
fix: diagnostic message for class name 'Object' when targeting differ…
idango10 7bb4eb4
fix failing tests
idango10 18aa75b
fix format issue
idango10 538e542
Merge branch 'idango/61270' of https://github.com/idango10/TypeScript…
idango10 2b7a547
fix: update diagnostic message for class name 'Object' to reflect tar…
idango10 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -7598,7 +7598,7 @@ export const enum ScriptKind { | |
| // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, | ||
| // `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, | ||
| // compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. | ||
| export const enum ScriptTarget { | ||
| export enum ScriptTarget { | ||
|
||
| /** @deprecated */ | ||
| ES3 = 0, | ||
| ES5 = 1, | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
| /// <reference path="fourslash.ts" /> | ||
|
|
||
| // @target: es2024 | ||
| // @module: commonjs | ||
|
|
||
| // @filename: test.ts | ||
| //// namespace NS { class Object {} } | ||
|
|
||
| verify.getSemanticDiagnostics([{ | ||
| code: 2725, | ||
| message: "Class name cannot be 'Object' when targeting ES2024 with module CommonJS.", | ||
| range: { pos: 21, end: 27, fileName: "test.ts" } | ||
| }]); |
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.
We shouldn't be using reverse mapping to find the names of language versions, as this depends on how the enum is defined and will break if two things alias each other. We should have some other standard way to print out target kinds like this.
I'd personally suggest just making the message say "ES5 and above".