dequelabs / dequelabs/axe-core
axe.addReporter() isDefault option broken
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
**expected** The third argument of `addReporter` is a boolean that should update the default reporter:
```js
axe.addReporter('new-reporter', (res, opt, cb) => {
cb('hello world')
}, true)
```
**actual**: Instead, the `v1` reporter is used unless you set the reporter through `axe.configure()` or some other solution.
This sets a local `let let defaultReporter` variable in `core/public/reporter.js`. However because when `options.reporter` is left undefined it gets set to `v1` that `defaultReporter` is just ignored. I think the solution here would just be for that `addReporter()` to call `axe.configure({ reporter: newReporter })`. This has the second benefit that `axe.reset()` will restore the reporter to `v1`.
I think we can just get rid of the `defaultReporter` prop. As far as I can tell, because of this bug, it is never used.
Contributor guide
Assessment
This issue has not been assessed yet.