From f1eb7691f27b3972d97db4070a15c43c3ce9e374 Mon Sep 17 00:00:00 2001
From: Kate Higa <16447748+khiga8@users.noreply.github.com>
Date: Wed, 12 Jul 2023 17:20:37 -0400
Subject: [PATCH 1/4] Rename rule to be prefixed with a11y
---
...-supports-aria-props.md => a11y-role-supports-aria-props.md} | 0
...-supports-aria-props.js => a11y-role-supports-aria-props.js} | 0
...-supports-aria-props.js => a11y-role-supports-aria-props.js} | 2 +-
3 files changed, 1 insertion(+), 1 deletion(-)
rename docs/rules/{role-supports-aria-props.md => a11y-role-supports-aria-props.md} (100%)
rename lib/rules/{role-supports-aria-props.js => a11y-role-supports-aria-props.js} (100%)
rename tests/{role-supports-aria-props.js => a11y-role-supports-aria-props.js} (99%)
diff --git a/docs/rules/role-supports-aria-props.md b/docs/rules/a11y-role-supports-aria-props.md
similarity index 100%
rename from docs/rules/role-supports-aria-props.md
rename to docs/rules/a11y-role-supports-aria-props.md
diff --git a/lib/rules/role-supports-aria-props.js b/lib/rules/a11y-role-supports-aria-props.js
similarity index 100%
rename from lib/rules/role-supports-aria-props.js
rename to lib/rules/a11y-role-supports-aria-props.js
diff --git a/tests/role-supports-aria-props.js b/tests/a11y-role-supports-aria-props.js
similarity index 99%
rename from tests/role-supports-aria-props.js
rename to tests/a11y-role-supports-aria-props.js
index 0192b96d..ca4ef1ac 100644
--- a/tests/role-supports-aria-props.js
+++ b/tests/a11y-role-supports-aria-props.js
@@ -10,7 +10,7 @@
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-const rule = require('../lib/rules/role-supports-aria-props')
+const rule = require('../lib/rules/a11y-role-supports-aria-props')
const RuleTester = require('eslint').RuleTester
const ruleTester = new RuleTester({
From 5bd661d01ee660f9fd3a8145eb194dfcfabb7e67 Mon Sep 17 00:00:00 2001
From: Kate Higa <16447748+khiga8@users.noreply.github.com>
Date: Wed, 12 Jul 2023 17:22:16 -0400
Subject: [PATCH 2/4] Update names
---
README.md | 2 +-
docs/rules/a11y-role-supports-aria-props.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 14aedd58..efe2fca7 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,7 @@ This config will be interpreted in the following way:
| :----------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |
| [a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md) | [aria-label] text should be formatted as you would visual text. | ⚛️ | | |
| [a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md) | disallow generic link text | | | ❌ |
+| [a11y-role-supports-aria-props](docs/rules/a11y-role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ | | |
| [array-foreach](docs/rules/array-foreach.md) | enforce `for..of` loops over `Array.forEach` | ✅ | | |
| [async-currenttarget](docs/rules/async-currenttarget.md) | disallow `event.currentTarget` calls inside of async functions | 🔍 | | |
| [async-preventdefault](docs/rules/async-preventdefault.md) | disallow `event.preventDefault` calls inside of async functions | 🔍 | | |
@@ -103,7 +104,6 @@ This config will be interpreted in the following way:
| [no-useless-passive](docs/rules/no-useless-passive.md) | disallow marking a event handler as passive when it has no effect | 🔍 | 🔧 | |
| [prefer-observers](docs/rules/prefer-observers.md) | disallow poorly performing event listeners | 🔍 | | |
| [require-passive-events](docs/rules/require-passive-events.md) | enforce marking high frequency event handlers as passive | 🔍 | | |
-| [role-supports-aria-props](docs/rules/role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ | | |
| [unescaped-html-literal](docs/rules/unescaped-html-literal.md) | disallow unescaped HTML literals | 🔍 | | |
diff --git a/docs/rules/a11y-role-supports-aria-props.md b/docs/rules/a11y-role-supports-aria-props.md
index 1cc8b7bc..0894e26f 100644
--- a/docs/rules/a11y-role-supports-aria-props.md
+++ b/docs/rules/a11y-role-supports-aria-props.md
@@ -1,4 +1,4 @@
-# Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role` (`github/role-supports-aria-props`)
+# Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role` (`github/a11y-role-supports-aria-props`)
💼 This rule is enabled in the ⚛️ `react` config.
From 48233469b290fd07884c16c87107c22dce3cf8fb Mon Sep 17 00:00:00 2001
From: Kate Higa <16447748+khiga8@users.noreply.github.com>
Date: Wed, 12 Jul 2023 17:25:52 -0400
Subject: [PATCH 3/4] Update names
---
lib/configs/react.js | 2 +-
lib/index.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/configs/react.js b/lib/configs/react.js
index 68eda59a..523e8805 100644
--- a/lib/configs/react.js
+++ b/lib/configs/react.js
@@ -10,7 +10,7 @@ module.exports = {
rules: {
'jsx-a11y/role-supports-aria-props': 'off', // Override with github/role-supports-aria-props until https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/910 is resolved
'github/a11y-aria-label-is-well-formatted': 'error',
- 'github/role-supports-aria-props': 'error',
+ 'github/a11y-role-supports-aria-props': 'error',
'jsx-a11y/no-aria-hidden-on-focusable': 'error',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/anchor-ambiguous-text': [
diff --git a/lib/index.js b/lib/index.js
index c4a8b3ee..a959594c 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -2,6 +2,7 @@ module.exports = {
rules: {
'a11y-no-generic-link-text': require('./rules/a11y-no-generic-link-text'),
'a11y-aria-label-is-well-formatted': require('./rules/a11y-aria-label-is-well-formatted'),
+ 'a11y-role-supports-aria-props': require('./rules/a11y-role-supports-aria-props'),
'array-foreach': require('./rules/array-foreach'),
'async-currenttarget': require('./rules/async-currenttarget'),
'async-preventdefault': require('./rules/async-preventdefault'),
@@ -18,7 +19,6 @@ module.exports = {
'no-then': require('./rules/no-then'),
'no-useless-passive': require('./rules/no-useless-passive'),
'prefer-observers': require('./rules/prefer-observers'),
- 'role-supports-aria-props': require('./rules/role-supports-aria-props'),
'require-passive-events': require('./rules/require-passive-events'),
'unescaped-html-literal': require('./rules/unescaped-html-literal'),
},
From 57dfee5a7dca838880d27ecdf4f7bee4e451a69a Mon Sep 17 00:00:00 2001
From: Kate Higa <16447748+khiga8@users.noreply.github.com>
Date: Wed, 12 Jul 2023 17:28:37 -0400
Subject: [PATCH 4/4] regenerate doc
---
README.md | 2 +-
tests/a11y-role-supports-aria-props.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index efe2fca7..4da7ca9f 100644
--- a/README.md
+++ b/README.md
@@ -86,7 +86,7 @@ This config will be interpreted in the following way:
| :----------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |
| [a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md) | [aria-label] text should be formatted as you would visual text. | ⚛️ | | |
| [a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md) | disallow generic link text | | | ❌ |
-| [a11y-role-supports-aria-props](docs/rules/a11y-role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ | | |
+| [a11y-role-supports-aria-props](docs/rules/a11y-role-supports-aria-props.md) | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ | | |
| [array-foreach](docs/rules/array-foreach.md) | enforce `for..of` loops over `Array.forEach` | ✅ | | |
| [async-currenttarget](docs/rules/async-currenttarget.md) | disallow `event.currentTarget` calls inside of async functions | 🔍 | | |
| [async-preventdefault](docs/rules/async-preventdefault.md) | disallow `event.preventDefault` calls inside of async functions | 🔍 | | |
diff --git a/tests/a11y-role-supports-aria-props.js b/tests/a11y-role-supports-aria-props.js
index ca4ef1ac..b1b41fe5 100644
--- a/tests/a11y-role-supports-aria-props.js
+++ b/tests/a11y-role-supports-aria-props.js
@@ -27,7 +27,7 @@ function getErrorMessage(attribute, role) {
return `The attribute ${attribute} is not supported by the role ${role}.`
}
-ruleTester.run('role-supports-aria-props', rule, {
+ruleTester.run('a11y-role-supports-aria-props', rule, {
valid: [
{code: '