eslint-plugin-material-ui-unused-classes icon indicating copy to clipboard operation
eslint-plugin-material-ui-unused-classes copied to clipboard

Detects all classes as not used, even when they are

Open benmneb opened this issue 3 years ago • 2 comments

project made with create-react-app using "react-scripts": "4.0.3"

heres the relevent package.json:

"eslintConfig": { "extends": [ "react-app", "react-app/jest" ], "plugins": [ "mui-unused-classes" ], "rules": { "mui-unused-classes/unused-classes": 1 } }, "devDependencies": { "eslint-plugin-mui-unused-classes": "^1.0.3" }

shows errors: Screen Shot 2021-06-28 at 10 42 16 am Screen Shot 2021-06-28 at 10 45 52 am

even though the classes/styles are used: Screen Shot 2021-06-28 at 10 43 25 am

🤔 what am i doing wrong?

benmneb avatar Jun 28 '21 02:06 benmneb

i'm seeing the same result, using makeStyles(), maybe that's the issue?

chapati23 avatar Oct 05 '21 17:10 chapati23

Were you able to solve the problem? I have the exact same issue.

bmurtagh01 avatar May 25 '22 20:05 bmurtagh01

v1 of this plugin expects you to instantiate your styles as

const classes = useStyles()

v2 (which I just released) is more flexible, you should be able to name your hook and the classes instance however you like.

jens-ox avatar Jan 08 '23 12:01 jens-ox