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

fix(rule): don't check keyup events for some elements #772

Merged
merged 3 commits into from
Mar 2, 2019
Merged

fix(rule): don't check keyup events for some elements #772

merged 3 commits into from
Mar 2, 2019

Conversation

mohammedzamakhan
Copy link
Contributor

fixes #771

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));
Copy link
Owner

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

@rafaelss95 rafaelss95 left a 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 Show resolved Hide resolved
src/util/getAttributeValue.ts Outdated Show resolved Hide resolved
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));
Copy link
Collaborator

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?

src/util/isInteractiveElement.ts Outdated Show resolved Hide resolved
@mgechev mgechev merged commit a9c4ae9 into mgechev:master Mar 2, 2019
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

Successfully merging this pull request may close these issues.

bug: template-click-events-have-key-events: Exclude interactive elements
3 participants