Skip to content
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

Better errors when using properties/methods from newer versions of ECMAScript #40320

Open
DanielRosenwasser opened this issue Aug 30, 2020 · 2 comments

Comments

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Aug 30, 2020

This is kind of the progression of #25309, and this issue's fix should be inspired by #27034.


Lots of users seem to be confused by misconfiguration when using popular new methods added to built-in types. A recent example is #40319.

The idea here come up with a static list of methods added to

  • Array
  • String
  • RegExp
  • ObjectConstructor
  • Promise
  • Map
  • Set
  • Iterator
  • AsyncIterator

in newer versions of ECMAScript. These can be found in src/lib.

When a user tries to access a property on any of these types, and that type appears in the list, we can provide a suggestion to set their lib or target (which we've done in other error messages). For example:

Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.
@DanielRosenwasser DanielRosenwasser changed the title Suggest useful augmentations from newer versions of ECMAScript Better errors when using properties/methods from newer versions of ECMAScript Aug 30, 2020
@sarathps93
Copy link

@sarathps93 sarathps93 commented Aug 30, 2020

Is it ok if I take this up as my first issue? @DanielRosenwasser

@Vboivin
Copy link
Contributor

@Vboivin Vboivin commented Sep 9, 2020

Hey @sarathps93, are you still working on this? If not, I'll try this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.