Description
When investigating switching from ViewEngine to ivy we stumbled on a problem where we had components with the same attribute being passed in twice and the behaviour is different between view engine and ivy. e.g. consider the component:
@Component({
selector: 'foo',
template: '{{ bar }}',
})
export class FooComponent {
@Input() bar: string
}
Is used like this:
<foo [bar]="'bam'" [bar]="'baz'"></foo>
ViewEngine: uses the first input and prints bam
Ivy: uses the second input and prints baz
So I think this would make sense as a lint rule to detect these duplicate attributes so that they can be removed (usually they are added by accident by merge conflicts). I did a quick check with AST explorer and it looks like they are represented in the
AST so it should be possible to write a lint rule to detect them.
I would be happy to work on this myself, I think it should be straightforward to implement. If anyone has any suggestions on a descriptive name for the rule that would be very helpful 🚲