Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jens-ox/eslint-plugin-material-ui-unused-classes

Detect unused Material UI styling classes using eslint
https://github.com/jens-ox/eslint-plugin-material-ui-unused-classes

eslint eslint-plugin material-ui

Last synced: 3 months ago
JSON representation

Detect unused Material UI styling classes using eslint

Awesome Lists containing this project

README

        

# Detect unused Material-UI classes

This eslint plugin lets you detect unused Material UI classes:

![Example image of the rule working](./.github/preview.png)

# Usage

1. Add the dependency:
```sh
npm i --save-dev eslint-plugin-mui-unused-classes
```

2. Add it at the end of your plugin list in your `.eslintrc.js`:
```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`:

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