Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Conversation

mysticatea
Copy link
Member

This PR fixes eslint-scope to support new export * as foo from "source" syntax in ES2020.

The syntax has added the exported property into the ExportAllDeclaration node for as foo. The foo identifier makes no references, so eslint-scope must ignore the exported property.

In more general, eslint-scope should ignore the Export(All|Default|Named)Declaration nodes if the node has their source property (FromClause). Currently eslint-scope does so for only ExportNamedDeclaration, therefore this PR adds Export(All|Default)Declaration, too.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ExportDeclaration(node) {
this.visitExportDeclaration(node);
}

ExportAllDeclaration(node) {
this.visitExportDeclaration(node);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this just be empty?
ExportAllDeclaration is specced to always have a source (eg it always exports from an external module and defines no local variables).

I know that visitExportDeclaration does if (node.source) { do nothing }, but why bother with the function call?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I thought that people expect the method visitExportDeclaration to be called on all export declarations because of the name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants