-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-unused-variable from tslint is not sufficient to angular 2 project #86
Comments
It makes sense to create a rule |
@netstart I was thinking that might be a good idea to keep this rule for the next version when we support external templates. Currently it will be only misleading for the users if we mark a variable as unused. |
Before implementing it take a look at angular/angular#11422 about accessing private properties when using AoT. Also some key notes from http://stackoverflow.com/a/39000046/2320455:
I'd think about creating the converse rule: to verify that all properties usages in template are with public access. |
Thanks for the comment! We have such rule already. |
The |
This is even greater motivation to include such rule in codelyzer. Now we support external templates so we can make it happen. I'm afraid that the release will become too big so I'd suggest to move this feature as part of the next one. |
Still, the no-unused-vars will rise only for private members, and as @dzonatan said, all template binded properties should be public. (There is a rule for that already) |
Any suggestions to get VS Code to work with Angular component fields showing up as unused like WebStorm can? https://stackoverflow.com/questions/43700420/angular2-with-vs-code-intellisense |
no-unused-variable from tslint is not sufficient to angular 2 project. We need verify teamplate html
"no-unused-variable": true,
Look researched variable for exemple.
If use this variable only in tamplate we receive a Message:
Failed to lint: login/modulos/components/areabox/area-box-list.component.ts [38, 20]: Unused property: 'researched'.
The text was updated successfully, but these errors were encountered: