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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: forbid comma separated selectors in selectors #499

Open
layershifter opened this issue Jan 26, 2024 · 1 comment
Open

lint: forbid comma separated selectors in selectors #499

layershifter opened this issue Jan 26, 2024 · 1 comment
Labels
馃拝 enhancement New feature or request

Comments

@layershifter
Copy link
Member

We need add a ESLint rule that will forbid :hover,:active selectors.

makeStyles({
  root: {
     // 馃煝 should pass
    ":hover": { color: "red" },
    ":active": { color: "blue" },
    // 馃敶 should break
    ":hover,:active": { color: "blue" },
  },
});

For context, #495.

@layershifter layershifter added the 馃拝 enhancement New feature or request label Jan 26, 2024
@NotWoods
Copy link
Member

Possibly as an option, I think it would be helpful to allow comma-separated selectors only if they all include &.

makeStyles({
  root: {
     // 馃煝 should pass
    "&:hover, &:active": { color: "blue" },
    // 馃敶 should break
    ":hover,&:active": { color: "blue" },
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃拝 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants