We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a template contains a structural directive, the no-unused-css rule ignores the element.
no-unused-css
The following example will report a Unused Style violation.
Unused Style
@Component({ selector: 'hero-cmp', template: ` <h1>Hello <div ><span></span>{{ her.name }}</div></h1> `, styles: [ ` h1 spam { color: red; } ` ] }) class Hero { private hero: Hero; test=true; ngOnInit() { console.log('Initialized'); } }
If we change the code slightly to the following, the violation is not present anymore.
@Component({ selector: 'hero-cmp', template: ` <h1>Hello <div *ngIf="test"><span></span>{{ her.name }}</div></h1> `, styles: [ ` h1 spam { color: red; } ` ] }) class Hero { private hero: Hero; test=true; ngOnInit() { console.log('Initialized'); } }
The text was updated successfully, but these errors were encountered:
fix: allow structural directives for no-unused-css rule
0aff6b7
fixes mgechev#249
tmair
Successfully merging a pull request may close this issue.
When a template contains a structural directive, the
no-unused-css
rule ignores the element.The following example will report a
Unused Style
violation.If we change the code slightly to the following, the violation is not present anymore.
The text was updated successfully, but these errors were encountered: