Skip to content

Report excess property errors on object literal names #53129

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

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Mar 7, 2023

it's a spiritual follow-up to #52943
the problem was noticed by @jakebailey here

Note that this is how it was already behaving in JSX so it unifies both paths, see the playground here

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 7, 2023
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

const name = propDeclaration.name!;
errorNode = name;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this basically uses the same strategy to overwrite the errorNode as the one used by the JSX-related code path here:
https://github.dev/microsoft/TypeScript/blob/6dbec02a88156121c24a152d1e8e5e82d52fdc1d/src/compiler/checker.ts#L20691

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Are we missing any more cases? 😄

@Andarist
Copy link
Contributor Author

Andarist commented Mar 7, 2023

Love it! Are we missing any more cases? 😄

I plan to grep the test cases against all multi-line errors. I think that this should find all candidates for potential improvements - gonna categorize them and rethink if error spans can be improved for any of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants