Skip to content

Only the first did-you-mean-colon error in an object literal is reported #47056

Closed
@sandersn

Description

@sandersn
const o = {
  x = 1,
  y = 2,
  #z: 3
}

Expected: 3 errors: Two did-you-mean-colon-not-equals error and one no-private-outside-class error.
Actual: 1 error: Just the first did-you-mean error.

The problem is that the check in checkGrammarObjectLiteralExpression concludes with return grammarErrorOnNode, whereas all the other checks don't return. The first step is to remove the return, and then make sure no other bogus errors get issued in the loop body that was previously getting skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions