githubEdit

🧹Detecting unused classes

There is an ESLint pluginarrow-up-right that detects unused classes for makeStyles and the Modern API:

Usage

  1. Add the dependency:

  1. Enable it in you ESLint config

Case 1: You have installed ESLint manually: Edit your eslint.config.js file:

Example projectarrow-up-right

Case 2: You are (still) in a create-react-apparrow-up-right project: Edit your package.json:

Example projetarrow-up-right

Disabling warnings

In case of false positive, disabling the warning:

  • For a line: // eslint-disable-next-line tss-unused-classes/unused-classes

  • For the entire file: // eslint-disable-next-line tss-unused-classes/unused-classes

Last updated

Was this helpful?