Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jens-ox/eslint-plugin-material-ui-unused-classes
- Owner: jens-ox
- Created: 2020-12-01T11:55:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-17T21:28:31.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T23:26:28.043Z (3 months ago)
- Topics: eslint, eslint-plugin, material-ui
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 31
- Watchers: 4
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-material-ui - Eslint: detect unused classes - ESLint plugin to detect unused styling classes with `@mui/styles`. (Related Projects)
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
}
}
```