You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I use @fluentui/react-components and style by using makeStyles.
This feature proposal is making the new ESLint Rules.
For example.
exportconstComponent=()=>{conststyles=useStyles()return(<divclassName={styles.wrapper}><p>hello</p></div>)}constuseStyles=makeStyles({wrapper: {},// ⚠️ this class should be warned because it's not usedform: {}})
This above example means that the makeStyles code should be warned because it has unused styles.
Please consider it.
Have you discussed this feature with our team
no
Additional context
no
Validations
Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Priority
Normal
The text was updated successfully, but these errors were encountered:
fluent v9 core doesn't contain css in js implementation anymore ( we use griffel for css in js ), thus can you please open this issue on griffel repo ?
Last but not least, I'd suggest to add "motivation" behind this rule to provide better motivation. for example: shipping less JS for unused rule definitions etc.
layershifter
changed the title
[Feature]: Add new ESLint rule which warn unused makeStyles classes
lint: add lint rule which warn unused makeStyles classes
Jan 19, 2024
FYI I transferred the issue to Griffel repository.
This rule could be easily implemented for a case when makeStyles() and useStyles() call are in the same file. However, it's more complicated for a case when useStyles() gets imported from a different file:
Library
React Components / v9 (@fluentui/react-components)
Describe the feature that you would like added
Currently, I use @fluentui/react-components and style by using makeStyles.
This feature proposal is making the new ESLint Rules.
For example.
This above example means that the makeStyles code should be warned because it has unused styles.
Please consider it.
Have you discussed this feature with our team
no
Additional context
no
Validations
Priority
Normal
The text was updated successfully, but these errors were encountered: