Detect unused tss-react makestyles
This eslint plugin lets you detect unused tss-react makestyles:
Usage
- Add the dependency:
yarn add --dev eslint-plugin-tss-unused-makestyles
- Enable it in you ESLint config
Case 1: You are in a create-react-app
project:
Edit your package.json
:
{
//...
"eslintConfig": {
"plugins": [
//...
"tss-unused-makestyles"
],
"rules": {
"tss-unused-makestyles/unused-makestyles": "warn"
}
}
//...
}
Case 2: You have installed ESLint manually:
Edit your .eslintrc.js
file:
module.exports = {
// ...
plugins: [
// ...
"tss-unused-makestyles",
],
rules: {
// ...
"tss-unused-makestyles/unused-makestyles": "warn",
},
};
Disabling warnings
In case of false positive, disabling the warning:
- For a line:
// eslint-disable-next-line tss-unused-makestyles/unused-makestyles
- For the entire file:
// eslint-disable-next-line tss-unused-makestyles/unused-makestyles