🧹
Detecting unused classes
- 1.Add the dependency:
yarn add --dev eslint-plugin-tss-unused-classes
- 1.Enable it in you ESLint config
{
//...
"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'
}
}
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
Last modified 10mo ago