ngx-unused-css
ngx-unused-css copied to clipboard
@use rules must be written before any other rules.
This is more of a feature request than a bug.
Today ngx-unused-css requires that @use rules are written before any other rules including @import. This creates an issue in two known situations..
- stylelint no-invalid-position-at-import-rule rule. This is a useful rule to ensure @import is not used improperly in the scss file
- Angular material theming requires @import '~@angular/material/theming'; for defining a custom theme. You would then utilize @use below it to define your custom theme files.
The reason I state this is not really a bug, and more of a request is the @import rule in general is going to become deprecated according to SASS's @import documentation.
At some point this means Angular material theming won't utilize @import for custom theming and the styelint check will be irrelevant. In the meantime though, to use styelint and ngx-unused-css together we need to disable the stylelint no-invalid-position-at-import-rule.
As I'd like to prepare my code for @use and @forward implementation to replace @import, it would be a nice feature to not have the @use rule throw if @import is used before it.
agreed this is not working with Angular Material 14 due to @use