eslint-plugin-tss-unused-classes
v1.0.3
Published
eslint plugin to detect unused tss-react styling classes
Downloads
51,533
Maintainers
Readme
Detect unused tss-react classes
This eslint plugin lets you detect unused tss-react classes:
https://user-images.githubusercontent.com/6702424/167231369-4eaeb5b2-bb39-4647-9911-086572c5e212.mov
Usage
- Add the dependency:
yarn add --dev eslint-plugin-tss-unused-classes
- Enable it in you ESLint config
Case 1: You are in a create-react-app
project:
Edit your package.json
:
{
//...
"eslintConfig": {
"plugins": [
//...
"tss-unused-classes"
],
"rules": {
"tss-unused-classes/unused-classes": "warn"
}
},
//...
}
Case 2: You have installed ESLint manually:
Edit your .eslintrc.js
file:
module.exports = {
// ...
plugins: [
// ...
'tss-unused-classes'
],
rules: {
// ...
'tss-unused-classes/unused-classes': 'warn'
}
}
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