This rule aims to find unused SX stylesheet definitions.
Examples of incorrect code for this rule:
import sx from '@adeira/sx';
export default function MyComponent() {
return null;
}
// Unused ⚠️
const styles = sx.create({
aaa: { color: 'red' },
});
import sx from '@adeira/sx';
export default function MyComponent() {
return <div className={styles('aaa')} />;
}
const styles = sx.create({
aaa: { color: 'red' },
bbb: { color: 'blue' }, // Unused ⚠️
ccc: { color: 'green' }, // Unused ⚠️
});
Examples of correct code for this rule:
import sx from '@adeira/sx';
export default function MyComponent() {
return <div className={styles('aaa')} />;
}
const styles = sx.create({
aaa: { color: 'red' },
});
none
There should be no valid reason to turn this rule off. It helps with a dead code elimination.