Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Conversation

@rinti
Copy link
Member

@rinti rinti commented May 22, 2019

This will add a11y linter with their recommended settings. I suggest we try this out for a while and adjust the rules as we go if we find some things too strict.

Example component:

    <div className="Hero">
        <h1 className="Hero__Title">{title}</h1>
        <img src="http://placehold.it/400x400" />
        <a href="#">Link with invalid href</a>
    </div>

And output:

  8:9  error  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
  9:9  error  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant