dequelabs / dequelabs/axe-core
Consider not exporting global if AMD or CommonJS module definition succeeded.
Open
breaking change
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
Expectation: When loading axe as an AMD module, I don't expect to also have a global variable named 'axe'
Actual: Axe always export unconditionally on window when in browser context.
Motivation: Exporting on window can cause axe to override an existing value assigned to this name ('axe' is quite short and could be realistically picked as a name by a bundler/minifier for large enough bundles)
Code is here: https://github.com/dequelabs/axe-core/blob/deed0f150680dccf20c3199410a6f00960a202dd/lib/core/index.js#L26
Contributor guide
Assessment
This issue has not been assessed yet.