Skip to content

parser: module information does not include default exports of interfaces #10644

@nebrius

Description

@nebrius

I've got a small follow-up to #10556.

import oxc from 'oxc-parser';

const code = `
export default interface Foo {
  bar: string;
}`;

const result = oxc.parseSync('/project/a.ts', code, {
  sourceType: 'module',
});

console.log(result.module.staticExports);

Actual output:

[] // empty array

Expected output:

An array with an entry describing the export.

Note: this is correctly reported:

export default type Bar = {
  baz: string;
}

Now this one is definitely an edge case, and personally speaking if I was reviewing a PR where someone tried to do a default export of an interface I'd flag it. But it is technically legal syntax.

Metadata

Metadata

Assignees

Labels

A-semanticArea - SemanticC-bugCategory - Buggood first issueExperience Level - Good for newcomers

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions