I try to use Eslint to find useless dependencies injection in my Angular/Ionic components.
Example:
import { BasicDataService } from '../../providers/basic-data.service';
@Component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {
constructor(
private bd: BasicDataService,
) {}
}
The property bd is defined in the constructor but then it is not used, how could Eslint highlight it?
My .eslintrc.json so far is:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
}
In one previous project, I used the rule @typescript-eslint/no-unused-vars-experimental
but it seems it has been removed recently.
Thanks!