Skip to content

Conversation

@khiga8
Copy link
Collaborator

@khiga8 khiga8 commented Nov 16, 2021

Closes #1

Changes

  • Adds GitHub::Accessibility::ImageHasAlt. When enabled, this rule will raise a lint error if an img tag is found without an alt attribute set. The alt attribute must be set to an empty string if the image is decorative, or a string that describes either the image, or the functional use.
  • Adds better documentation of lint rules, inspired by eslint-plugin-github.


## Rule Details

`<img>` should have an alt prop with meaningful text or an empty string for decorative images.
Copy link

@bolonio bolonio Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be must instead of should? (same for all instances). Other than that, looks good to me :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must does come off a bit stronger but I think both are ok :)

@khiga8 khiga8 marked this pull request as ready for review November 23, 2021 16:58
@khiga8 khiga8 merged commit 8c0182d into main Nov 23, 2021
@khiga8 khiga8 deleted the kh-add_alt_rule branch November 23, 2021 23:30
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.

Add better documentation of lint rule

3 participants