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

Incorrect typings for Check.evaluate and Check.after #974

Closed
stephenmathieson opened this issue Jun 26, 2018 · 1 comment · Fixed by #976
Closed

Incorrect typings for Check.evaluate and Check.after #974

stephenmathieson opened this issue Jun 26, 2018 · 1 comment · Fixed by #976

Comments

@stephenmathieson
Copy link
Member

When we pass custom "checks" into axe-core, they're expected to be strings, not functions. In createExecutionContext, we explicitly support casting strings (via eval) to a function.

However, the TypeScript definition suggests only functions are allowed.

I do not know if both functions and strings are supported. If they are, adding a type union (evaluate: Function | string) should work. If they're not supported, then replacing Function with string will solve this.

@WilcoFiers
Copy link
Contributor

@stephenmathieson Yes, this can be either a function or a string, so your suggestion sounds correct. Please put in a PR to fix it.

stephenmathieson added a commit that referenced this issue Jun 27, 2018
These types may either be a string or a function.

Closes #974
WilcoFiers pushed a commit that referenced this issue Jun 28, 2018
* fix(axe.d.ts): correct `Check.evaluate` and `Check.after` types

These types may either be a string or a function.

Closes #974

* ci: trigger build
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 a pull request may close this issue.

2 participants