๐ - New eslint rule `@taiga-ui/no-invalid-icon-name`
Closed this issue ยท 0 comments
splincode commented
Description
Which @taiga-ui/* package(s) are relevant/releated to the feature request?
eslint-plugin
Description
Check that all icons inside our components are actually exists.
Suggested solution
- Look for all occurence of
tuiIcon...
insideprojects/**
and NOT inside['projects/icons/**', 'projects/demo/**']
(all these paths should be configurable parameters because they will be different for our proprietary repo) - Check that this icon exits inside
projects/icons/constants/icons.ts
(this path should be configurable parameter because it will be different for our proprietary repo)
Examples
Valid โ
get icon(): string {
return this.isPasswordHidden ? 'tuiIconHideLarge' : 'tuiIconShowLarge';
}
Invalid โ
get icon(): string {
return this.isPasswordHidden ? 'tuiIconNotShowLarge' : 'tuiIconShowLarge';
~~~~~~~~~~~~~~~~~~~~
}
Valid โ
<tui-svg src="tuiIconChevronDown"></tui-svg>
Invalid โ
<tui-svg src="tuiIconChevroletDown"></tui-svg>
~~~~~~~~~~~~~~~~~~~~