ArrowFunctionExpression fails to check arrow functions without body and the type is also wrong
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 194
- Avg merge
- 22h 43m
- Merged PRs (30d)
- 10
Description
There are arrow functions whose body is a JSXExpression, like this:
```ts
const bla = (name: string) =>
```
That function will return false if you run `ArrowFunctionExpression.check(path)` and also the body type is wrongly defined here:
https://github.com/benjamn/ast-types/blob/b99f9b3ef5000631c06d71d91ee7aa341c9a81fb/gen/namedTypes.ts#L339
Because the type of that body is JSXElement, which doesn't have a nested body, which the other two does. This can lead to uncaught bugs.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in gen/namedTypes.ts around the ArrowFunctionExpression definition referenced by the issue, then inspect ArrowFunctionExpression.check(path) and the related arrow-function body types. Ensure JSXElement is represented correctly alongside the other supported body types, and verify that the resulting type check handles the JSX-bodied example without uncaught errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100