-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Good First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScriptUpdate Docs on Next ReleaseIndicates that this PR affects docsIndicates that this PR affects docs
Milestone
Description
Search Terms
quickfix, jsx, function
Suggestion
quick fix for function only contains one jsx element and have not the return statement
Use Cases
the pattern of a function with block body that only have one jsx element without return statement
that seems a error
could we provide a quickfix for that?
Examples
items.map(x => {
<div>123</div>
})
to
items.map(x => (
<div>123</div>
))
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)
DanielRosenwasser
Metadata
Metadata
Assignees
Labels
Domain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Good First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScriptUpdate Docs on Next ReleaseIndicates that this PR affects docsIndicates that this PR affects docs