From be03f3598c7eb640e74312a639a4fa860b6ec695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Bolonio?= Date: Tue, 19 Jul 2022 12:00:06 +0000 Subject: [PATCH 1/2] Add new linter rule: LinkHasHref --- README.md | 3 ++ docs/rules/accessibility/link-has-href.md | 25 +++++++++++++++ .../github/accessibility/link_has_href.rb | 32 +++++++++++++++++++ .../accessibility/link_has_href_test.rb | 23 +++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 docs/rules/accessibility/link-has-href.md create mode 100644 lib/erblint-github/linters/github/accessibility/link_has_href.rb create mode 100644 test/linters/accessibility/link_has_href_test.rb diff --git a/README.md b/README.md index df80e45..2febb2a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ linters: enabled: true GitHub::Accessibility::ImageHasAlt: enabled: true + GitHub::Accessibility::LinkHasHref: + enabled: true GitHub::Accessibility::NoAriaLabelMisuseCounter: enabled: true GitHub::Accessibility::NoPositiveTabIndex: @@ -47,6 +49,7 @@ linters: - [GitHub::Accessibility::AvoidGenericLinkTextCounter](./docs/rules/accessibility/avoid-generic-link-text-counter.md) - [GitHub::Accessibility::IframeHasTitle](./docs/rules/accessibility/iframe-has-title.md) - [GitHub::Accessibility::ImageHasAlt](./docs/rules/accessibility/image-has-alt.md) +- [GitHub::Accessibility::LinkHasHref](./docs/rules/accessibility/link_has_href.md) - [GitHub::Accessibility::NoAriaLabelMisuseCounter](./docs/rules/accessibility/no-aria-label-misuse-counter.md) - [GitHub::Accessibility::NoPositiveTabIndex](./docs/rules/accessibility/no-positive-tab-index.md) - [GitHub::Accessibility::NoRedundantImageAlt](./docs/rules/accessibility/no-redundant-image-alt.md) diff --git a/docs/rules/accessibility/link-has-href.md b/docs/rules/accessibility/link-has-href.md new file mode 100644 index 0000000..e172bc5 --- /dev/null +++ b/docs/rules/accessibility/link-has-href.md @@ -0,0 +1,25 @@ +# Link Has Href + +## Rule Details + +Links should go somewhere, you probably want to use a `