oxc/tasks
Arnaud Barré d9cc429d4a
fix(parser): parse empty method declaration as TSEmptyBodyFunctionExpression (#2574)
That a tricky one, because it's time to decide what does ESTree
compliant means in the TS world (re #2463)

This code:

```ts
export declare class ByteBuffer {
  clear(): void;
     // ^^
}
```

- Is parsed by
[Babel](d38530204e)
as `FunctionExpression` with an empty body
- By
[TS-ESLint](4ea4e2feb5)
as
[TSEmptyBodyFunctionExpression](https://github.com/typescript-eslint/typescript-eslint/pull/1289)
- By
[OXC](https://oxc-project.github.io/oxc/playground/?code=3YCAAIC1gICAgICAgICyHorESipoTXPdvBaE9wxzlOraoWs19SUxDvdcwSVU0kbBO2b7ppX3x2P5IhQlpGHOYEHNCEfLf38HUICA)
as `TSDeclareFunction`

I'm going the easy way to fix this to the Babel way, but I think
following TS-ESLint would make sense. There is an [open babel
issue](https://github.com/babel/babel/issues/13878) about that.

Edit: Ok that not so easy and require updating some logic.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-03-03 13:59:17 +00:00
..
benchmark feat(codegen): add sourcemap (#2565) 2024-03-03 14:44:49 +08:00
common chore(benchmark): add radix-ui.jsx as a real world jsx example (#2304) 2024-02-05 13:42:45 +08:00
coverage fix(parser): parse empty method declaration as TSEmptyBodyFunctionExpression (#2574) 2024-03-03 13:59:17 +00:00
javascript_globals chore(deps): update cargo (#2191) 2024-01-29 11:38:47 +08:00
lint_rules chore(lint_rules): deprecated eslint no-dupe-args / no-octal / no-with 2024-02-02 17:33:54 +08:00
minsize feat(codegen): configurable typescript codegen (#2443) 2024-02-20 12:09:28 +08:00
prettier_conformance [BREAKING CHANGE] Change Atom to Atom<'a> to make it safe (#2497) 2024-02-26 19:34:40 +08:00
rulegen fix(tasks/rulegen): Parse 'export default' test file for plugin-jsdoc (#2510) 2024-02-26 14:31:51 +08:00
transform_conformance feat(transformer/typescript): support transform constructor method (#2551) 2024-03-01 21:12:30 +08:00
libs.txt refactor(benchmark): use more complicated files (#1811) 2023-12-25 17:27:02 +08:00