griffel
griffel copied to clipboard
lint: forbid comma separated selectors in selectors
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, https://github.com/microsoft/griffel/discussions/495.
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" },
},
});
Waiting for partners to enable linting, considering for H2/2024