Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 732 Bytes

File metadata and controls

38 lines (31 loc) · 732 Bytes

Detect unused Material-UI classes

This eslint plugin lets you detect unused Material UI classes:

Example image of the rule working

Usage

  1. Add the dependency:
npm i --save-dev eslint-plugin-mui-unused-classes
  1. Add it at the end of your plugin list in your .eslintrc.js:
module.exports = {
  // ...
  plugins: [
    // ...
    'mui-unused-classes'
  ]
}

That's it! You should now get a warning if you have unused classes. One could also make it an error by adding the actual rule to the rule entry in .eslintrc.js:

module.exports = {
  // ...
  plugins: [
    // ...
    'mui-unused-classes'
  ],
  rules: {
    'mui-unused-classes/unused-classes': 2
  }
}