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

no-input-rename fails if input alias is prefixed with directive selector #705

Closed
marcincichocki opened this issue Aug 27, 2018 · 1 comment

Comments

@marcincichocki
Copy link

marcincichocki commented Aug 27, 2018

Currently codelyzer doesn't allow to rename inputs of a directive other than its selector.

@Directive({
  selector: '[appHighlight]',
})
export class HighlightDirective {
  // works with codelyzer 4.4
  @Input('appHighlight') visible = true;

  // still an error
  @Input('appHighlightColor') color = 'yellow';
}
<h1 appHighlight appHighlightColor="red">Demo</h1>

In example above HighlightDirective#color have alias prefixed with directive's selector to prevent name collisions within the template(if component or other directive have same input prop).

If this means anything, @angular/material uses this convention(for example: https://github.com/angular/material2/blob/6.4.6/src/lib/sort/sort.ts#L76)

Thank you for this amazing project!

@mgechev
Copy link
Owner

mgechev commented Aug 29, 2018

@marcincichocki thanks for reporting this! I can see that @rafaelss95 already took care of the issue ⚡️. I'll review & merge today.

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