-
Notifications
You must be signed in to change notification settings - Fork 13
feat: align TSModuleDeclaration with babel-typescript #38
feat: align TSModuleDeclaration with babel-typescript #38
Conversation
dcd8e88
to
f2015fa
Compare
Nice one, @armano2, thanks! |
thank you 👍 |
Hmm, global augmentation is not a module declaration, so I feel wrongness if we express it as ( |
@mysticatea typescript is using one node for it to, with node flags https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html
|
|
🎉 This PR is included in version 5.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
btw. i'm not disagreeing with you, and i think its weird to have one node for this. https://github.com/JamesHenry/typescript-estree#ast-alignment-tests |
It's the related argument in #28. Currently we have inconsistent expressions for the |
In fact, JavaScript AST and TypeScript AST have really different mental models. The fact has appeared in, for example, tc39/proposal-decorators#69. In JavaScript AST, it expresses semantics as independent nodes. E.g., On the other hand, TypeScript AST closes to the source code. In TypeScript AST, ESTree is the former, but TypeScript is the latter. In other word, in |
hmm, than maybe we should go for wrapper node as you proposed in #28 this PR got merged really fast xd |
This PR adds optional
global
property toTSModuleDeclaration
AST in case whenIn Babel/Typescript we have
fixes: #27, eslint/typescript-eslint-parser#570