You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In TypeScript, trying to assign the reporter to axe.configure fails as the RawResult type that the reporter uses is not the same as the RawResult that axe-core uses.
I was surprised this wasn't caught in a test but then I discovered that the one test where we try to use the reporter assigns it as any so it's never type checked.
importreporterfrom'@axe-core/reporter-earl';axe.configure({ reporter });/*error TS2322: Type '(rawResults: RawResult[], {}: {}, callback: Function) => void' is not assignable to type 'string | AxeReporter<unknown>'. Type '(rawResults: RawResult[], {}: {}, callback: Function) => void' is not assignable to type 'AxeReporter<unknown>'. Types of parameters 'rawResults' and 'rawResults' are incompatible. Type 'import("/node_modules/axe-core/axe").RawResult[]' is not assignable to type 'RawResult[]'. Type 'import("/node_modules/axe-core/axe").RawResult' is not assignable to type 'RawResult'. Types of property 'violations' are incompatible. Type 'RawNodeResult<"failed">[]' is not assignable to type 'RawNodeResult[]'. Property 'node' is missing in type 'RawNodeResult<"failed">' but required in type 'RawNodeResult'.2 axe.configure({ reporter });*/
The text was updated successfully, but these errors were encountered:
straker
changed the title
reporter-earl: reporter is not compatible with axe-core
reporter-earl: reporter type is not compatible with axe-core
Nov 22, 2023
In TypeScript, trying to assign the reporter to
axe.configure
fails as theRawResult
type that the reporter uses is not the same as theRawResult
that axe-core uses.I was surprised this wasn't caught in a test but then I discovered that the one test where we try to use the reporter assigns it as
any
so it's never type checked.The text was updated successfully, but these errors were encountered: