Closed csk-trackunit closed 1 month ago
@csk-trackunit The imports are only picked up from JS and TS files since we're using SWC to find them.
I'll convert this to a feature request since it is asking for external dependencies to be parsed from CSS files as well.
A workaround to your issue might to add the import to the component file instead.
import 'react-image-gallery/styles/css/image-gallery.css;
That will import the file as a global CSS file, and SWC should be able to find it.
Current Behavior
I'm using @nx/dependency-checks with eslint to make sure that all dependencies used in a publishable lib is included in the package.json of that lib. Recently we had an issue where installing that lib in an external project failed due to a missing dependency. We tracked it down to an import in a css-file, that was not detected by the linter.
Expected Behavior
I would expect all dependencies of a lib to be found by the linter.
GitHub Repo
https://github.com/csk-trackunit/dependency-issue
Steps to Reproduce
nx lint PubLi
@import "react-image-gallery/styles/css/image-gallery.css";
is not discovered by the linter.see
https://github.com/csk-trackunit/dependency-issue/blob/main/README.md
for more details.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response