eslint-plugin-material-ui-unused-classes
eslint-plugin-material-ui-unused-classes copied to clipboard
ignore css keyframes animation styles
Hi! Thanks for great rule, i've already clean a lot of unused styles.
But for now css keyframes animation rules parsed incorrectly e.g.:
const useStyles = makeStyles(() => ({
animatedDiv: {
animation: '$myAnimation 1s linear',
},
'@keyframes myAnimation': { },
});
causes error "ESLint: Class undefined
is unused(mui-unused-classes/unused-classes)", which has two problems:
- We need to look for usage in other styles not in component (also as you see usage started with $ without '@keyframes ' prefix)
- Class in error has 'undefined' name because '@keyframes myAnimation' is a key with Literal type which doesn't contain key.name property
For now I just add ignore because it blocks the rule usage.