https://github.com/pyramation/babel-issue-15215
https://github.com/pyramation/babel-issue-15215
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyramation/babel-issue-15215
- Owner: pyramation
- License: mit
- Created: 2022-10-11T08:33:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-23T10:31:56.000Z (over 3 years ago)
- Last Synced: 2025-03-13T02:03:50.567Z (over 1 year ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel issue #15215
`typeParameters` for `ArrowFunctionExpression` w/o specifying always gets a trailingComma
https://github.com/babel/babel/issues/15215
## expected result
```js
const useDeployment = ({
request,
options
}: UseDeploymentQuery) => {
return useQuery(["deploymentQuery", request], () => {
if (!queryService) throw new Error("Query Service not initialized");
return queryService.deployment(request);
}, options);
};
```
## actual result
```js
const useDeployment = ({
request,
options
}: UseDeploymentQuery) => {
return useQuery(["deploymentQuery", request], () => {
if (!queryService) throw new Error("Query Service not initialized");
return queryService.deployment(request);
}, options);
};
```
## diff result
Adds a comma:
```diff
+const useDeployment = ({
-const useDeployment = ({
```
# how to run
```
yarn
yarn test:watch
```
## files of interest
- [output snapshot](https://github.com/pyramation/babel-issue-15215/blob/main/__tests__/__snapshots__/pure.test.ts.snap)
- [test file with AST](https://github.com/pyramation/babel-issue-15215/blob/main/__tests__/pure.test.ts)