Files
88ef27dd56 Merge babel-check-duplicated-nodes into monorepo (#14420)
* Working helper

* Added pkg.json description

* 1.0.0

* cleanup build scripts

* refactor: convert to TS

* add checkDuplicateNodes to parser tests

* remove babel core injection

* ignore check-duplicate-nodes and readme generator

* add test cases

* refactor: simplify duplicate nodes tracking

Co-authored-by: Mateusz Burzyński <[email protected]>
2022-04-05 20:00:29 -04:00

65 lines
1.4 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`checkDuplicateNodes should throw on duplicate AST nodes within different parent 1`] = `
"Do not reuse nodes. Use \`t.cloneNode\` (or \`t.clone\`/\`t.cloneDeep\` if using babel@6) to copy them.
{
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
}
Parent:
[
{
\\"type\\": \\"VariableDeclarator\\",
\\"id\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
},
\\"init\\": null
},
{
\\"type\\": \\"AssignmentExpression\\",
\\"operator\\": \\"=\\",
\\"left\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
},
\\"right\\": {
\\"type\\": \\"NullLiteral\\"
}
}
]"
`;
exports[`checkDuplicateNodes should throw on duplicate AST nodes within same parent 1`] = `
"Do not reuse nodes. Use \`t.cloneNode\` (or \`t.clone\`/\`t.cloneDeep\` if using babel@6) to copy them.
{
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
}
Parent:
[
{
\\"type\\": \\"VariableDeclarator\\",
\\"id\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
},
\\"init\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
}
},
{
\\"type\\": \\"VariableDeclarator\\",
\\"id\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
},
\\"init\\": {
\\"type\\": \\"Identifier\\",
\\"name\\": \\"ref\\"
}
}
]"
`;