Skip to content
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

Feature request: template-no-any #633

Closed
rafaelss95 opened this issue May 26, 2018 · 0 comments
Closed

Feature request: template-no-any #633

rafaelss95 opened this issue May 26, 2018 · 0 comments

Comments

@rafaelss95
Copy link
Collaborator

rafaelss95 commented May 26, 2018

A rule to disallow the $any(...) usage:

interface Human {
  name: string;
}

@Component({
  // $any() nullifies the compile-time benefits of the type system.
  template: '<p>Hello {{ $any(human).age }}</p>'
})
export class AppComponent {
  human: Human = { name: 'Human' };
  // human has no field age, so the template should not compile
}

Similar to https://palantir.github.io/tslint/rules/no-any/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants