-
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
fix(rule): don't check keyup events for some elements #772
Conversation
src/util/attributesComparator.ts
Outdated
import { getLiteralValue } from './getLiteralValue'; | ||
|
||
function attributesComparator(baseAttributes: any = [], el: ElementAst): boolean { | ||
const attributes: Array<AttrAst | BoundElementProperty> = [].concat(...(el.attrs as any), ...(el.inputs as any)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to refactor it to use sets/maps, so we can drop the quadratic check to a linear one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if possible, can we remove these any
casts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelss95 done
@mgechev I have two different arrays, I don't think I can escape the quadratic check here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to avoid the any
usage where possible :)
src/util/attributesComparator.ts
Outdated
import { getLiteralValue } from './getLiteralValue'; | ||
|
||
function attributesComparator(baseAttributes: any = [], el: ElementAst): boolean { | ||
const attributes: Array<AttrAst | BoundElementProperty> = [].concat(...(el.attrs as any), ...(el.inputs as any)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if possible, can we remove these any
casts?
fixes #771