Currently, we do not explicitly handle the transformation of SyntaxKind.ModuleDeclaration.
As per discussions with Andy, we want to move more towards modifiers being applied as booleans on the node, rather than persisting the array of modifiers (where possible).
Because we are falling back with deeplyCopy(), we are also currently persisting name from the original TSNode, whereas we should be using id.
E.g. the refactored AST diff would be something like:
- "modifiers": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 7,
- "line": 1,
- },
- "start": Object {
- "column": 0,
- "line": 1,
- },
- },
- "range": Array [
- 0,
- 7,
- ],
- "type": "TSDeclareKeyword",
- },
- ],
+ "declare": true,
- "name": Object {
+ "id": Object {
I do not believe this change will have a negative impact on linting capabilities, and downstream dependencies can easily be updated to check for the boolean.