test-a11y-js 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/linter/eslint-plugin/index.js +1 -1
- package/dist/linter/eslint-plugin/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,6 +129,61 @@ module.exports = {
|
|
|
129
129
|
- `plugin:test-a11y-js/react` - Optimized for React/JSX
|
|
130
130
|
- `plugin:test-a11y-js/vue` - Optimized for Vue SFC
|
|
131
131
|
|
|
132
|
+
#### Ignoring Files and Lines
|
|
133
|
+
|
|
134
|
+
Sometimes you need to ignore specific files or lines. Here are your options:
|
|
135
|
+
|
|
136
|
+
**Ignore a single line:**
|
|
137
|
+
```jsx
|
|
138
|
+
// eslint-disable-next-line test-a11y-js/image-alt
|
|
139
|
+
<img src="decorative.jpg" alt="" />
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Ignore an entire file:**
|
|
143
|
+
```jsx
|
|
144
|
+
/* eslint-disable test-a11y-js/heading-order */
|
|
145
|
+
// Entire file exempt from heading-order rule
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Ignore directories:**
|
|
149
|
+
```javascript
|
|
150
|
+
// .eslintrc.js
|
|
151
|
+
module.exports = {
|
|
152
|
+
plugins: ['test-a11y-js'],
|
|
153
|
+
extends: ['plugin:test-a11y-js/recommended'],
|
|
154
|
+
ignorePatterns: [
|
|
155
|
+
'**/node_modules/**',
|
|
156
|
+
'**/dist/**',
|
|
157
|
+
'**/*.test.{js,ts,jsx,tsx}' // Optional: exclude test files
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Disable rules for specific files:**
|
|
163
|
+
```javascript
|
|
164
|
+
// .eslintrc.js
|
|
165
|
+
module.exports = {
|
|
166
|
+
plugins: ['test-a11y-js'],
|
|
167
|
+
extends: ['plugin:test-a11y-js/recommended'],
|
|
168
|
+
overrides: [
|
|
169
|
+
{
|
|
170
|
+
files: ['**/legacy/**'],
|
|
171
|
+
rules: {
|
|
172
|
+
'test-a11y-js/**': 'warn' // Only warnings in legacy code
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Vue template ignore:**
|
|
180
|
+
```vue
|
|
181
|
+
<!-- eslint-disable-next-line test-a11y-js/image-alt -->
|
|
182
|
+
<img src="photo.jpg" />
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
> **Best Practice:** Always add a comment explaining why you're ignoring a rule. For example: `// eslint-disable-next-line test-a11y-js/image-alt -- Decorative image, no semantic meaning`
|
|
186
|
+
|
|
132
187
|
### Quick Start for Large Projects
|
|
133
188
|
|
|
134
189
|
```javascript
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-a11y-js",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Zero-config accessibility testing for React, Vue & JSX. ESLint plugin + programmatic API. Catch a11y issues before production.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|