oxc/crates
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
..
oxc Publish crates v0.8.0 2024-02-26 19:01:51 +08:00
oxc_allocator Publish crates v0.8.0 2024-02-26 19:01:51 +08:00
oxc_ast fix(parser): parse empty method declaration as TSEmptyBodyFunctionExpression (#2574) 2024-03-03 13:59:17 +00:00
oxc_cli feat(cli,linter): provide tsconfig path from the cli (#2526) 2024-02-27 20:00:11 +08:00
oxc_codegen feat(codegen): add sourcemap (#2565) 2024-03-03 14:44:49 +08:00
oxc_diagnostics Publish crates v0.8.0 2024-02-26 19:01:51 +08:00
oxc_index Publish crates v0.8.0 2024-02-26 19:01:51 +08:00
oxc_js_regex [BREAKING CHANGE] Change Atom to Atom<'a> to make it safe (#2497) 2024-02-26 19:34:40 +08:00
oxc_language_server fix(oxc_language_server): use config path at init (#2569) 2024-03-03 14:01:16 +08:00
oxc_linter fix(linter): fix getter return rule false positives in TypeScript (#2543) 2024-03-01 13:42:13 +00:00
oxc_macros
oxc_minifier refactor(span): move base54 method to mangler (#2523) 2024-02-27 13:34:33 +08:00
oxc_parser fix(parser): parse empty method declaration as TSEmptyBodyFunctionExpression (#2574) 2024-03-03 13:59:17 +00:00
oxc_prettier feat(ast): add "abstract" type to MethodDefinition and PropertyDefinition (#2536) 2024-02-28 17:33:11 +08:00
oxc_semantic fix(semantic): jsx reference with an incorrect node id (#2546) 2024-03-01 21:07:57 +08:00
oxc_span refactor(span): remove AtomImpl (#2525) 2024-02-27 13:45:58 +08:00
oxc_syntax feat(linter): remove all commonjs logic for import plugin (#2537) 2024-02-28 18:13:44 +08:00
oxc_transformer fix(ast): support FormalParameter.override (#2577) 2024-03-03 14:41:42 +08:00
oxc_wasm feat(wasm): call build module record when symbol is true (#2533) 2024-02-28 14:47:34 +08:00