Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jsx-a11y linter #21

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Add jsx-a11y linter #21

wants to merge 1 commit into from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant