An open API service indexing awesome lists of open source software.

https://github.com/pyramation/babel-issue-15215


https://github.com/pyramation/babel-issue-15215

Last synced: about 1 year ago
JSON representation

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)