-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
feat(25259): Better error report for equals instead of colon in object literals #38754
Conversation
This is nice! But I think part of what @JoshuaKGoldberg had in mind as a UX problem was that the left side of the So when we issue this error, we should also avoid resolving the left side, and instead treat that as a property declaration on the object instead of as a local binding name. |
@DanielRosenwasser Thanks for the feedback. For the following example, TS throws two errors const a = {
x: 1,
y = 1
~ ~
}
As I understood, the first error should be omitted and the error should be assigned to the property, not to const a = {
x: 1,
y = 1
~~~~~
}
|
That's correct, though I don't feel that strongly about issuing the error on the |
971fa5f
to
432ad50
Compare
@typescript-bot pack this |
Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at 432ad50. You can monitor the build here. |
Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build. |
I'm waiting on a playground build because I want to understand the behavior (e.g. does hovering over the symbol cause issues etc.) |
an hour seems suspicious, let me have a look - yep, a weird issue with setting up the azure CLI will try re-trigger |
@typescript-bot pack this |
Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at 16b0746. You can monitor the build here. |
Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build. |
So the following let x = { foo = 100 }
x.foo has some strange behavior where find-all-references isn't consistent on any location of I'm not totally against this, but how easy would it be to special case this so that the If it is too much of a pain, I would be okay with merging the change. @sheetalkamat, any concerns there? Also, probably worth adding a test like let foo = "hello"
let x = { foo = 100 }
x.foo |
I think this is due to checking the value of the property. |
…on in object literals
Fixes #25259