Skip to content

Commit 64dcac6

Browse files
committedApr 8, 2022
[New] Introduce a plugin-wide setting for custom components.
For #174
1 parent 1826628 commit 64dcac6

File tree

71 files changed

+1317
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1317
-691
lines changed
 

‎README.md

+18
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ Add `plugin:jsx-a11y/recommended` or `plugin:jsx-a11y/strict` in `extends`:
8989
}
9090
```
9191

92+
To enable your custom components to be checked as DOM elements, you can set global settings in your
93+
configuration file by mapping each custom component name to a DOM element type.
94+
95+
```json
96+
{
97+
"settings": {
98+
"jsx-a11y": {
99+
"components": {
100+
"CityInput": "input",
101+
"CustomButton": "button",
102+
"MyButton": "button",
103+
"RoundButton": "button"
104+
}
105+
}
106+
}
107+
}
108+
```
109+
92110
## Supported Rules
93111

94112
<!-- AUTO-GENERATED-CONTENT:START (LIST) -->

‎__tests__/__util__/parserOptionsMapper.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function parserOptionsMapper({
1111
errors,
1212
options = [],
1313
parserOptions = {},
14+
settings,
1415
}) {
1516
return {
1617
code,
@@ -20,5 +21,6 @@ export default function parserOptionsMapper({
2021
...defaultParserOptions,
2122
...parserOptions,
2223
},
24+
settings,
2325
};
2426
}

0 commit comments

Comments
 (0)
Please sign in to comment.