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
Environment
node: v22.22.3
mlly: 1.8.2
Reproduction
run
findStaticImports('import "styles.css";')[0].importsand see that it isundefinedDescribe the bug
Side effect imports are valid so the
importsproperty should actually be optional but it's currently typed as astring.When you parse something like
import "styles.css";theimportsproperty will beundefined.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