Skip to content

The StaticImport['imports'] type is incorrect #349

Description

Environment

node: v22.22.3
mlly: 1.8.2

Reproduction

run findStaticImports('import "styles.css";')[0].imports and see that it is undefined

Describe the bug

Side effect imports are valid so the imports property should actually be optional but it's currently typed as a string.

When you parse something like import "styles.css"; the imports property will be undefined.

There is already a test case that covers side effect imports but it does not validate that the returned object matches the shape described by the type.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions