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 JSX property error messages #23117

Closed
mhegazy opened this issue Apr 3, 2018 · 0 comments
Closed

Better JSX property error messages #23117

mhegazy opened this issue Apr 3, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Apr 3, 2018

JSX component property errors are limited in nature. seems like there is one of three categories:

  • missing required property
  • wrong property type
  • additional unknown property

Currently we rely on the assignablity error message which a. includes information about intrinsic types, react types, etc.. and b. does not pin point the offending property.
We can do better by reporting the errors on the specific property in cases of failed assignablity, and be more explicit about what it is that the user is doing wrong.. e.g. "Missed required property 'x'ortype of property 'y' does not match expected..

image

Related to #23116

Originally reported in https://twitter.com/keeskluskens/status/981168047204458501

@mhegazy mhegazy added Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter Domain: Error Messages The issue relates to error messaging labels Apr 3, 2018
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Apr 3, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 4, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants