Template style checking for GitHub's Ruby projects
Перейти к файлу
Kate Higa b71d4e9810 add require 2023-06-08 19:18:53 -04:00
.github Update dependabot.yml 2023-06-01 09:39:43 -04:00
config add require 2023-06-08 19:18:53 -04:00
docs Update docs 2023-06-08 18:26:43 -04:00
lib Reorganization structure 2023-06-08 18:50:04 -04:00
test Remove counter-related tests 2023-06-08 18:25:08 -04:00
.gitignore commit gemfile.lock 2021-12-01 12:34:20 -08:00
.rubocop.yml Update .rubocop.yml 2023-06-02 07:28:19 -04:00
CODEOWNERS Add codeowners file 2022-03-10 14:11:49 -08:00
Gemfile add dependencies, linter, test 2021-10-20 10:21:39 -07:00
Gemfile.lock Update rubocop requirement from = 1.51.0 to = 1.52.0 2023-06-05 04:05:06 +00:00
LICENSE Initial commit 2021-10-19 10:16:21 -07:00
README.md Remove counter config code 2023-06-08 18:23:27 -04:00
Rakefile Update dev dependencies 2022-06-10 16:48:55 -07:00
erblint-github.gemspec Update rubocop requirement from = 1.51.0 to = 1.52.0 2023-06-05 04:05:06 +00:00

README.md

erblint-github

Template style checking for GitHub's Ruby projects

Setup

  1. Update your Gemfile and run bundle install
gem "erb_lint", require: false
gem "erblint-github"
  1. Require the linters within the .erb-linters folder. This could be done by adding a file .erb-linters/erblint-github.rb with the following line.
require "erblint-github/linters"
  1. Update the erb-lint.yml to configure the rule.

.erb-lint.yml

---
linters:
  GitHub::Accessibility::AriaLabelIsWellFormatted:
    enabled: true
  GitHub::Accessibility::AvoidBothDisabledAndAriaDisabled:
    enabled: true
  GitHub::Accessibility::AvoidGenericLinkText:
    enabled: true
  GitHub::Accessibility::DisabledAttribute:
    enabled: true
  GitHub::Accessibility::IframeHasTitle:
    enabled: true
  GitHub::Accessibility::ImageHasAlt:
    enabled: true
  GitHub::Accessibility::NavigationHasLabel:
    enabled: true
  GitHub::Accessibility::LinkHasHref:
    enabled: true
  GitHub::Accessibility::NestedInteractiveElements:
    enabled: true
  GitHub::Accessibility::NoAriaHiddenOnFocusable:
    enabled: true
  GitHub::Accessibility::NoAriaLabelMisuse:
    enabled: true
  GitHub::Accessibility::NoPositiveTabIndex:
    enabled: true
  GitHub::Accessibility::NoRedundantImageAlt:
    enabled: true
  GitHub::Accessibility::NoTitleAttribute:
    enabled: true
  GitHub::Accessibility::SvgHasAccessibleText:
    enabled: true

Rules

Testing

bundle install
bundle exec rake

If you use VS Code, we highly encourage ERB Linter extension to see immediate feedback in your editor.

Note

This repo contains several accessibility-related linting rules to help surface accessibility issues that would otherwise go undetected until a later stage. Please note that due to the limitations of static code analysis, these ERB accessibility checks are NOT enough for ensuring the accessibility of your app. This shouldn't be the only tool you use to catch accessibility issues and should be supplemented with other tools that can check the runtime browser DOM output, as well as processes like accessibility design reviews, manual audits, user testing, etc.