constructor(
private modalCtrl: ModalController,
private navParams: NavParams,
private changeDetectorRef: ChangeDetectorRef
) {
this.saloon = navParams.data.saloon
this.services = navParams.data.services
}
with tslint.json configuration:
{
"rules": {
"no-duplicate-variable": true,
"no-unused-variable": [
true
]
},
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules"
]
}
Property 'navParams' is declared but never used.
L20: private modalCtrl: ModalController,
L21: private navParams: NavParams,
L22: private saloonService: SaloonService,
No warnings about the 'navParams' variable that is actually been used.
These are no regular constructor parameters. They're so called parameter properties: https://www.stevefenton.co.uk/2013/04/stop-manually-assigning-typescript-constructor-parameters/
TypeScript automatically creates a property of the same name and type as the parameter. That property is never used. If you don't need the property, just omit the access modifier (private in your case) and everything is fine.
So this is working as intended.
You might argue that you are using the properties in the template, because it seems that's an Angular component. But that's not a valid use of private properties, refer to #3094 for an explanation.
I thought, it's, a bug, but actually not. Here is solution in duplicate issue:
https://github.com/palantir/tslint/issues/3420