Skip to content

Unpin axe-core for compatibility with new versions #586

@nwalters512

Description

@nwalters512

I recently updated axe-core to 4.8.2 in a project, but because the @sa11y/common package pins axe-core to 4.7.0, I end up with two distinct copies of axe-core in my project which don't have compatible types (see dequelabs/axe-core#4081). This causes TypeScript to complain:

    Type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/axe-core/axe").Result' is not assignable to type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/@sa11y/common/node_modules/axe-core/axe").Result'.
      Types of property 'nodes' are incompatible.
        Type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/axe-core/axe").NodeResult[]' is not assignable to type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/@sa11y/common/node_modules/axe-core/axe").NodeResult[]'.
          Type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/axe-core/axe").NodeResult' is not assignable to type 'import("/home/runner/work/PrairieLearn/PrairieLearn/node_modules/@sa11y/common/node_modules/axe-core/axe").NodeResult'.
            Types of property 'target' are incompatible.
              Type 'UnlabelledFrameSelector' is not assignable to type 'string[]'.
                Type 'CrossTreeSelector' is not assignable to type 'string'.
                  Type 'ShadowDomSelector' is not assignable to type 'string'.

This library should almost definitely unpin axe-core to allow new minor versions to be used without @sa11y/common needing to explicitly change.

I'd be happy to make this change if a maintainer could confirm that it will be accepted. It's not clear to me why the @sa11y/* packages pin dependencies in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions