Skip to content
New issue

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

ignore css keyframes animation styles #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

artem-gusev-qs
Copy link

@artem-gusev-qs artem-gusev-qs commented Aug 19, 2021

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:

  1. We need to look for usage in other styles not in component (also as you see usage started with $ without '@Keyframes ' prefix)
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant