diff --git a/.changeset/TSInterfaceDeclaration-compatibility-with-oxc-parser.md b/.changeset/TSInterfaceDeclaration-compatibility-with-oxc-parser.md new file mode 100644 index 0000000..bd77fd7 --- /dev/null +++ b/.changeset/TSInterfaceDeclaration-compatibility-with-oxc-parser.md @@ -0,0 +1,5 @@ +--- +"esrap": patch +--- + +`TSInterfaceDeclaration` compatibility with oxc parser diff --git a/src/languages/ts/index.js b/src/languages/ts/index.js index 7bb4f7c..e7b2007 100644 --- a/src/languages/ts/index.js +++ b/src/languages/ts/index.js @@ -1676,7 +1676,7 @@ export default (options = {}) => { context.write('interface '); context.visit(node.id); if (node.typeParameters) context.visit(node.typeParameters); - if (node.extends) { + if (node.extends && node.extends.length) { context.write(' extends '); sequence(context, node.extends, node.body.loc?.start ?? null, false); }