Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/infofarmer/eslint-plugin-jsx-a11y
https://github.com/infofarmer/eslint-plugin-jsx-a11y
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/infofarmer/eslint-plugin-jsx-a11y
- Owner: infofarmer
- Created: 2023-02-03T17:25:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T22:04:15.000Z (6 months ago)
- Last Synced: 2024-06-23T09:09:12.188Z (5 months ago)
- Language: JavaScript
- Size: 174 KB
- Stars: 22
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
This is not the official eslint repo.
Get professional support for eslint-plugin-jsx-a11y on Tidelift
# eslint-plugin-jsx-a11y
Static AST checker for accessibility rules on JSX elements.
#### _Read this in [other languages](https://github.com/ari-os310/eslint-plugin-jsx-a11y/blob/HEAD/translations/Translations.md)._
[Mexican Spanish๐ฒ๐ฝ](https://github.com/ari-os310/eslint-plugin-jsx-a11y/blob/HEAD/translations/README.mx.md)
## Why?
This plugin does aย static evaluation of the JSX to spot accessibility issues in React apps. Because it only catches errors in static code, use it in combination with [@axe-core/react](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/react) to test the accessibility of the rendered DOM. Consider theseย toolsย just as one step of a larger a11y testing process andย always test your apps with assistive technology.
## Installation
**If you are installing this plugin via `eslint-config-airbnb`, please follow [these instructions](https://github.com/airbnb/javascript/tree/HEAD/packages/eslint-config-airbnb#eslint-config-airbnb-1).**
You'll first need to install [ESLint](https://eslint.org/docs/latest/user-guide/getting-started):
```sh
# npm
npm install eslint --save-dev# yarn
yarn add eslint --dev
```Next, install `eslint-plugin-jsx-a11y`:
```sh
# npm
npm install eslint-plugin-jsx-a11y --save-dev# yarn
yarn add eslint-plugin-jsx-a11y --dev
```**Note:** If you installed ESLint globally (using the `-g` flag in npm, or the `global` prefix in yarn) then you must also install `eslint-plugin-jsx-a11y` globally.
## Usage
Add `jsx-a11y` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": ["jsx-a11y"]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"jsx-a11y/rule-name": 2
}
}
```You can also enable all the recommended or strict rules at once.
Add `plugin:jsx-a11y/recommended` or `plugin:jsx-a11y/strict` in `extends`:```json
{
"extends": ["plugin:jsx-a11y/recommended"]
}
```> As you are extending our configuration, you can omit `"plugins": ["jsx-a11y"]` from your `.eslintrc` configuration file.
To enable your custom components to be checked as DOM elements, you can set global settings in your
configuration file by mapping each custom component name to a DOM element type.```json
{
"settings": {
"jsx-a11y": {
"components": {
"CityInput": "input",
"CustomButton": "button",
"MyButton": "button",
"RoundButton": "button"
}
}
}
}
```## Supported Rules
๐ผ Configurations enabled in.\
๐ซ Configurations disabled in.\
โ๏ธ Set in the `recommended` configuration.\
๐ Set in the `strict` configuration.\
โ Deprecated.