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

JavaScript Package Exports More Than Just Main #337

@BekaValentine

Description

@BekaValentine

In the current implementation of the rules for JS, it looks to be true that the package-level exports consist of all the exports of all the files in the package. This seems to be intentional, to support package imports of the form require("pkg"), but this has the consequence of bringing into scope way more things than are actually in scope in JS.

The actual behavior is that the exports of only the package's main file should be accessible via package imports, but there isn't currently a mechanism to determine in a file is the package main.

For name resolution this is sub-optimal. But for VEA, this is a major issue because it means there will be many false positives.

cc @hendrikvanantwerpen

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions