diff --git a/README.md b/README.md index ab466b1..b5fb2ad 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ inherit_gem: rubocop-github: - config/default.yml - config/rails.yml - - config/accessibility.yml ``` +💭 Looking for `config/accessibility.yml` and the `GitHub/Accessibility` configs? They have been moved to [a new gem](https://github.com/github/rubocop-rails-accessibility). + ### Legacy usage If you are using a rubocop version < 1.0.0, you can use rubocop-github version diff --git a/config/accessibility.yml b/config/accessibility.yml deleted file mode 100644 index 1908cad..0000000 --- a/config/accessibility.yml +++ /dev/null @@ -1,15 +0,0 @@ -require: - - rubocop/cop/github/accessibility - -GitHub/Accessibility/ImageHasAlt: - Enabled: true - StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/image-has-alt.md -GitHub/Accessibility/LinkHasHref: - Enabled: true - StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/link-has-href.md -GitHub/Accessibility/NoPositiveTabindex: - Enabled: true - StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/no-positive-tabindex.md -GitHub/Accessibility/NoRedundantImageAlt: - Enabled: true - StyleGuide: https://github.com/github/rubocop-github/blob/master/guides/no-redundant-image-alt.md diff --git a/lib/rubocop/cop/github/accessibility/image_has_alt.rb b/lib/rubocop/cop/github/accessibility/image_has_alt.rb deleted file mode 100644 index 698d922..0000000 --- a/lib/rubocop/cop/github/accessibility/image_has_alt.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -require "rubocop" - -module RuboCop - module Cop - module GitHub - module Accessibility - class ImageHasAlt < Base - MSG = "Images should have an alt prop with meaningful text or an empty string for decorative images" - - def_node_search :has_alt_attribute?, "(sym :alt)" - - def on_send(node) - receiver, method_name, _= *node - - if receiver.nil? && method_name == :image_tag - alt = has_alt_attribute?(node) - add_offense(node.loc.selector) if alt.nil? - end - end - end - end - end - end -end diff --git a/lib/rubocop/cop/github/accessibility/link_has_href.rb b/lib/rubocop/cop/github/accessibility/link_has_href.rb deleted file mode 100644 index 751c564..0000000 --- a/lib/rubocop/cop/github/accessibility/link_has_href.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require "rubocop" - -module RuboCop - module Cop - module GitHub - module Accessibility - class LinkHasHref < Base - MSG = "Links should go somewhere, you probably want to use a `