eslint-plugin-jsx-a11y
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
@babel/runtime | 7.24.5 | 256.12 kB | MIT | prod | |
aria-query | 5.3.0 | 1 B | Apache-2.0 | prod | |
array-includes | 3.1.8 | 25.71 kB | MIT | prod | |
array.prototype.flatmap | 1.3.2 | 6.72 kB | MIT | prod | |
ast-types-flow | 0.0.7 | 8.36 kB | ISC | prod | |
axe-core | 4.9.0 | 2.66 MB | MPL-2.0 | prod | 1 |
axobject-query | 3.2.1 | 20.58 kB | Apache-2.0 | prod | |
damerau-levenshtein | 1.0.8 | 4.04 kB | BSD-2-Clause | prod | |
emoji-regex | 9.2.2 | 10.86 kB | MIT | prod | |
eslint | 8.57.0 | 2.9 MB | MIT | prod peer | |
has | 1.0.4 | 1.59 kB | MIT | prod | |
jsx-ast-utils | 3.3.5 | 33.4 kB | MIT | prod | |
language-tags | 1.0.5 | 10.43 kB | MIT | prod | 1 |
minimatch | 3.1.2 | 11.66 kB | ISC | prod | |
object.entries | 1.1.8 | 31.8 kB | MIT | prod | |
object.fromentries | 2.0.8 | 15.94 kB | MIT | prod | |
semver | 6.3.1 | 18.65 kB | ISC | prod |
The eslint-plugin-jsx-a11y is a static AST (Abstract Syntax Tree) checker for accessibility rules specifically designed for JSX elements. It evaluates the JSX statically in order to identify any accessibility issues within your React applications.
To use eslint-plugin-jsx-a11y, first, you need to install it in your JavaScript project. Install ESLint and plugin-jsx-a11y using npm or yarn as shown:
# npm
npm install eslint --save-dev
npm install eslint-plugin-jsx-a11y --save-dev
# yarn
yarn add eslint --dev
yarn add eslint-plugin-jsx-a11y --dev
Remember to install the plugin globally if you installed ESLint globally.
In your .eslintrc
configuration file, add jsx-a11y
to the plugins section. The eslint-plugin-
prefix can be omitted.
{
"plugins": ["jsx-a11y"]
}
Then specify the rules you wish to use under the rules section:
{
"rules": {
"jsx-a11y/rule-name": 2
}
}
You can enable all the recommended or strict rules at once by adding plugin:jsx-a11y/recommended
or plugin:jsx-a11y/strict
in the extends
section:
{
"extends": ["plugin:jsx-a11y/recommended"]
}
The eslint-plugin-jsx-a11y documentation is available on the GitHub repository under the Supported Rules section. The detailed rule description can be found through the linked Markdown files within each rule in this section.
Additionally, you can find more information on creating new rules, background on WAI-ARIA, the AX Tree and Browsers, and the plugin license on the same GitHub page. These sections provide vital knowledge for implementing and using the eslint-plugin-jsx-a11y package in your JavaScript project efficiently.