-
-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): parse empty method declaration as TSEmptyBodyFunctionExp…
…ression (#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](https://astexplorer.net/#/gist/9f43cf0fe91760e11f1572934681c92f/d38530204eaa6e12dbd14f3ef2d7d2fcb7da7bc2) as `FunctionExpression` with an empty body - By [TS-ESLint](https://astexplorer.net/#/gist/626dd346956a02c221d4e128450652af/4ea4e2feb5ae7bb8787f8c7e452d442c935c1f09) as [TSEmptyBodyFunctionExpression](typescript-eslint/typescript-eslint#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](babel/babel#13878) about that. Edit: Ok that not so easy and require updating some logic. --------- Co-authored-by: Boshen <[email protected]>
- Loading branch information
1 parent
9479865
commit d9cc429
Showing
3 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters