Skip to content

Commit 1b90cf2

Browse files
committed
add eslint-plugin-jsx-a11y for improved accessibility linting
1 parent 2b9937e commit 1b90cf2

File tree

3 files changed

+79
-2
lines changed

3 files changed

+79
-2
lines changed

eslint.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import globals from "globals";
22
import pluginJs from "@eslint/js";
33
import tseslint from "typescript-eslint";
44
import pluginReact from "eslint-plugin-react";
5-
5+
import jsxA11y from "eslint-plugin-jsx-a11y";
66

77
/** @type {import('eslint').Linter.Config[]} */
88
export default [
@@ -18,6 +18,9 @@ export default [
1818
...tseslint.configs.recommended,
1919
pluginReact.configs.flat.recommended,
2020
{
21+
plugins: {
22+
'jsx-a11y': jsxA11y,
23+
},
2124
rules: {
2225
"@typescript-eslint/ban-ts-comment": "off",
2326
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
@@ -33,6 +36,7 @@ export default [
3336
"prefer-const": "off",
3437
"react/jsx-key": "off",
3538
"react/no-unescaped-entities": "off",
39+
"jsx-a11y/alt-text": "off",
3640
}
3741
}
3842
];

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"@typescript-eslint/parser": "^8.16.0",
7777
"@vitejs/plugin-react-swc": "^3.7.0",
7878
"eslint": "^9.15.0",
79+
"eslint-plugin-jsx-a11y": "^6.10.2",
7980
"eslint-plugin-react": "^7.37.2",
8081
"globals": "^15.12.0",
8182
"sass": "^1.77.6",

yarn.lock

+73-1
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,11 @@ argparse@^2.0.1:
13911391
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
13921392
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
13931393

1394+
aria-query@^5.3.2:
1395+
version "5.3.2"
1396+
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.2.tgz#93f81a43480e33a338f19163a3d10a50c01dcd59"
1397+
integrity sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==
1398+
13941399
array-buffer-byte-length@^1.0.1:
13951400
version "1.0.1"
13961401
resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f"
@@ -1473,13 +1478,28 @@ arraybuffer.prototype.slice@^1.0.3:
14731478
is-array-buffer "^3.0.4"
14741479
is-shared-array-buffer "^1.0.2"
14751480

1481+
ast-types-flow@^0.0.8:
1482+
version "0.0.8"
1483+
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6"
1484+
integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==
1485+
14761486
available-typed-arrays@^1.0.7:
14771487
version "1.0.7"
14781488
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846"
14791489
integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==
14801490
dependencies:
14811491
possible-typed-array-names "^1.0.0"
14821492

1493+
axe-core@^4.10.0:
1494+
version "4.10.2"
1495+
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df"
1496+
integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==
1497+
1498+
axobject-query@^4.1.0:
1499+
version "4.1.0"
1500+
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee"
1501+
integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==
1502+
14831503
babel-plugin-emotion@^10.0.27:
14841504
version "10.2.2"
14851505
resolved "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.2.2.tgz#a1fe3503cff80abfd0bdda14abd2e8e57a79d17d"
@@ -2027,6 +2047,11 @@ d3@^7.3.0:
20272047
d3-transition "3"
20282048
d3-zoom "3"
20292049

2050+
damerau-levenshtein@^1.0.8:
2051+
version "1.0.8"
2052+
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7"
2053+
integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==
2054+
20302055
data-view-buffer@^1.0.1:
20312056
version "1.0.1"
20322057
resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2"
@@ -2130,6 +2155,11 @@ emoji-regex@^8.0.0:
21302155
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
21312156
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
21322157

2158+
emoji-regex@^9.2.2:
2159+
version "9.2.2"
2160+
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
2161+
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
2162+
21332163
emotion@^10.0.14:
21342164
version "10.0.27"
21352165
resolved "https://registry.npmjs.org/emotion/-/emotion-10.0.27.tgz#f9ca5df98630980a23c819a56262560562e5d75e"
@@ -2306,6 +2336,27 @@ escape-string-regexp@^4.0.0:
23062336
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
23072337
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
23082338

2339+
eslint-plugin-jsx-a11y@^6.10.2:
2340+
version "6.10.2"
2341+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz#d2812bb23bf1ab4665f1718ea442e8372e638483"
2342+
integrity sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==
2343+
dependencies:
2344+
aria-query "^5.3.2"
2345+
array-includes "^3.1.8"
2346+
array.prototype.flatmap "^1.3.2"
2347+
ast-types-flow "^0.0.8"
2348+
axe-core "^4.10.0"
2349+
axobject-query "^4.1.0"
2350+
damerau-levenshtein "^1.0.8"
2351+
emoji-regex "^9.2.2"
2352+
hasown "^2.0.2"
2353+
jsx-ast-utils "^3.3.5"
2354+
language-tags "^1.0.9"
2355+
minimatch "^3.1.2"
2356+
object.fromentries "^2.0.8"
2357+
safe-regex-test "^1.0.3"
2358+
string.prototype.includes "^2.0.1"
2359+
23092360
eslint-plugin-react@^7.37.2:
23102361
version "7.37.2"
23112362
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz#cd0935987876ba2900df2f58339f6d92305acc7a"
@@ -2976,7 +3027,7 @@ json-stringify-pretty-compact@^3.0.0, json-stringify-pretty-compact@~3.0.0:
29763027
resolved "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz"
29773028
integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==
29783029

2979-
"jsx-ast-utils@^2.4.1 || ^3.0.0":
3030+
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5:
29803031
version "3.3.5"
29813032
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a"
29823033
integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==
@@ -2993,6 +3044,18 @@ keyv@^4.5.4:
29933044
dependencies:
29943045
json-buffer "3.0.1"
29953046

3047+
language-subtag-registry@^0.3.20:
3048+
version "0.3.23"
3049+
resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz#23529e04d9e3b74679d70142df3fd2eb6ec572e7"
3050+
integrity sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==
3051+
3052+
language-tags@^1.0.9:
3053+
version "1.0.9"
3054+
resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.9.tgz#1ffdcd0ec0fafb4b1be7f8b11f306ad0f9c08777"
3055+
integrity sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==
3056+
dependencies:
3057+
language-subtag-registry "^0.3.20"
3058+
29963059
levn@^0.4.1:
29973060
version "0.4.1"
29983061
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
@@ -3729,6 +3792,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
37293792
is-fullwidth-code-point "^3.0.0"
37303793
strip-ansi "^6.0.1"
37313794

3795+
string.prototype.includes@^2.0.1:
3796+
version "2.0.1"
3797+
resolved "https://registry.yarnpkg.com/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz#eceef21283640761a81dbe16d6c7171a4edf7d92"
3798+
integrity sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==
3799+
dependencies:
3800+
call-bind "^1.0.7"
3801+
define-properties "^1.2.1"
3802+
es-abstract "^1.23.3"
3803+
37323804
string.prototype.matchall@^4.0.11:
37333805
version "4.0.11"
37343806
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz#1092a72c59268d2abaad76582dccc687c0297e0a"

0 commit comments

Comments
 (0)