diff --git a/docs/rule-overview/rule-overview.data.mts b/docs/rule-overview/rule-overview.data.mts index 857bcad9..172a93be 100644 --- a/docs/rule-overview/rule-overview.data.mts +++ b/docs/rule-overview/rule-overview.data.mts @@ -16,7 +16,7 @@ export default defineLoader({ const recommended = getRecommendedRules(); return rules.map((rule) => ({ name: rule.text, - link: rule.link, + link: formatRuleLink(rule.link), recommended: recommended.includes(rule.text) })); } @@ -32,3 +32,7 @@ function getRecommendedRules() { function removeRulePrefix(ruleName: string) { return ruleName.replace("vuejs-accessibility/", ""); } + +function formatRuleLink(ruleLink: string) { + return "..".concat(ruleLink); +} diff --git a/docs/rules/no-aria-hidden-on-focusable.md b/docs/rules/no-aria-hidden-on-focusable.md index bf2701a3..2c340b9d 100644 --- a/docs/rules/no-aria-hidden-on-focusable.md +++ b/docs/rules/no-aria-hidden-on-focusable.md @@ -1,4 +1,4 @@ -# no-aria-hidden-on-focusbable +# no-aria-hidden-on-focusable Enforce that `aria-hidden="true"` is not set on focusable elements or parent of focusable elements. diff --git a/docs/rules/no-role-presentation-on-focusable.md b/docs/rules/no-role-presentation-on-focusable.md index 2d5f0f3b..21b4177f 100644 --- a/docs/rules/no-role-presentation-on-focusable.md +++ b/docs/rules/no-role-presentation-on-focusable.md @@ -1,4 +1,4 @@ -# no-role-presentaion-on-focusbable +# no-role-presentation-on-focusable Enforce that `role="presentation"` is not set on focusable elements or parent of focusbale elements. diff --git a/package.json b/package.json index 65be7b9b..40828441 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-vuejs-accessibility", - "version": "2.4.0", + "version": "2.4.1", "description": "An eslint plugin for checking Vue.js files for accessibility", "main": "dist/index.js", "files": [ @@ -61,7 +61,7 @@ "semver": "^7.6.0", "ts-jest": "^29.0.3", "ts-node": "^10.3.0", - "typescript": "5.5.3", + "typescript": "5.5.4", "vitepress": "1.3.1" }, "eslintConfig": { diff --git a/src/index.ts b/src/index.ts index c9876182..f0886ebc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,10 +15,12 @@ import labelHasFor from "./rules/label-has-for"; import mediaHasCaption from "./rules/media-has-caption"; import mouseEventsHaveKeyEvents from "./rules/mouse-events-have-key-events"; import noAccessKey from "./rules/no-access-key"; +import noAriaHiddenOnFocusable from "./rules/no-aria-hidden-on-focusable"; import noAutofocus from "./rules/no-autofocus"; import noDistractingElements from "./rules/no-distracting-elements"; import noOnchange from "./rules/no-onchange"; import noRedundantRoles from "./rules/no-redundant-roles"; +import noRolePresentationOnFocusable from "./rules/no-role-presentation-on-focusable"; import noStaticElementInteractions from "./rules/no-static-element-interactions"; import roleHasRequiredAriaProps from "./rules/role-has-required-aria-props"; import tabindexNoPositive from "./rules/tabindex-no-positive"; @@ -42,10 +44,12 @@ const rules = { "media-has-caption": mediaHasCaption, "mouse-events-have-key-events": mouseEventsHaveKeyEvents, "no-access-key": noAccessKey, + "no-aria-hidden-on-focusable": noAriaHiddenOnFocusable, "no-autofocus": noAutofocus, "no-distracting-elements": noDistractingElements, "no-onchange": noOnchange, "no-redundant-roles": noRedundantRoles, + "no-role-presentation-on-focusable": noRolePresentationOnFocusable, "no-static-element-interactions": noStaticElementInteractions, "role-has-required-aria-props": roleHasRequiredAriaProps, "tabindex-no-positive": tabindexNoPositive diff --git a/yarn.lock b/yarn.lock index 4bd48cf0..ea7dec43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1353,15 +1353,15 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^7.0.0": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz#f5f5da52db674b1f2cdb9d5f3644e5b2ec750465" - integrity sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A== + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz#c8ed1af1ad2928ede5cdd207f7e3090499e1f77b" + integrity sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.16.1" - "@typescript-eslint/type-utils" "7.16.1" - "@typescript-eslint/utils" "7.16.1" - "@typescript-eslint/visitor-keys" "7.16.1" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/type-utils" "7.17.0" + "@typescript-eslint/utils" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" @@ -1386,13 +1386,21 @@ "@typescript-eslint/types" "7.16.1" "@typescript-eslint/visitor-keys" "7.16.1" -"@typescript-eslint/type-utils@7.16.1": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz#4d7ae4f3d9e3c8cbdabae91609b1a431de6aa6ca" - integrity sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA== +"@typescript-eslint/scope-manager@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz#e072d0f914662a7bfd6c058165e3c2b35ea26b9d" + integrity sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA== dependencies: - "@typescript-eslint/typescript-estree" "7.16.1" - "@typescript-eslint/utils" "7.16.1" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + +"@typescript-eslint/type-utils@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz#c5da78feb134c9c9978cbe89e2b1a589ed22091a" + integrity sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA== + dependencies: + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/utils" "7.17.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -1401,6 +1409,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.16.1.tgz#bbab066276d18e398bc64067b23f1ce84dfc6d8c" integrity sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ== +"@typescript-eslint/types@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.17.0.tgz#7ce8185bdf06bc3494e73d143dbf3293111b9cff" + integrity sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A== + "@typescript-eslint/typescript-estree@7.16.1": version "7.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz#9b145ba4fd1dde1986697e1ce57dc501a1736dd3" @@ -1415,15 +1428,29 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.16.1": - version "7.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.16.1.tgz#df42dc8ca5a4603016fd102db0346cdab415cdb7" - integrity sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA== +"@typescript-eslint/typescript-estree@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz#dcab3fea4c07482329dd6107d3c6480e228e4130" + integrity sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw== + dependencies: + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/utils@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.17.0.tgz#815cd85b9001845d41b699b0ce4f92d6dfb84902" + integrity sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.16.1" - "@typescript-eslint/types" "7.16.1" - "@typescript-eslint/typescript-estree" "7.16.1" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/typescript-estree" "7.17.0" "@typescript-eslint/visitor-keys@7.16.1": version "7.16.1" @@ -1433,6 +1460,14 @@ "@typescript-eslint/types" "7.16.1" eslint-visitor-keys "^3.4.3" +"@typescript-eslint/visitor-keys@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz#680465c734be30969e564b4647f38d6cdf49bfb0" + integrity sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A== + dependencies: + "@typescript-eslint/types" "7.17.0" + eslint-visitor-keys "^3.4.3" + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" @@ -2381,7 +2416,7 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ejs@^3.0.0: +ejs@^3.1.10: version "3.1.10" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== @@ -3082,9 +3117,9 @@ human-signals@^5.0.0: integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== husky@^9.0.5: - version "9.0.11" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" - integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== + version "9.1.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.1.tgz#73f8f1b58329f377654293148c1a6458f54ca224" + integrity sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg== iconv-lite@^0.4.24: version "0.4.24" @@ -5319,12 +5354,12 @@ ts-api-utils@^1.3.0: integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.0.3: - version "29.2.2" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.2.tgz#0d2387bb04d39174b20a05172a968f258aedff4d" - integrity sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg== + version "29.2.3" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.3.tgz#3d226ac36b8b820151a38f164414f9f6b412131f" + integrity sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ== dependencies: bs-logger "0.x" - ejs "^3.0.0" + ejs "^3.1.10" fast-json-stable-stringify "2.x" jest-util "^29.0.0" json5 "^2.2.3" @@ -5411,10 +5446,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" - integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== +typescript@5.5.4: + version "5.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" + integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== undici-types@~5.26.4: version "5.26.5"