Skip to content

Commit 229428c

Browse files
authored
Merge branch 'main' into main
2 parents 262d21e + abf72f1 commit 229428c

24 files changed

+970
-1007
lines changed

Diff for: CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1010

1111
- `labelComponents` options to add custom label components in `form-control-has-label`
1212

13+
## [1.1.1] - 2021-12-23
14+
1315
### Changed
1416

1517
- Deprecate the accessible-emoji rule. See https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/627 for details.
@@ -132,7 +134,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
132134

133135
- Initial release 🎉.
134136

135-
[unreleased]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v1.1.0...HEAD
137+
[unreleased]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v1.1.1...HEAD
138+
[1.1.1]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v1.1.0...v1.1.1
136139
[1.1.0]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v1.0.0...v1.1.0
137140
[1.0.0]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v0.7.1...v1.0.0
138141
[0.7.1]: https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/compare/v0.7.0...v0.7.1

Diff for: package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-vuejs-accessibility",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "An eslint plugin for checking Vue.js files for accessibility",
55
"main": "dist/index.js",
66
"scripts": {
@@ -29,25 +29,25 @@
2929
"dependencies": {
3030
"aria-query": "^5.0.0",
3131
"emoji-regex": "^10.0.0",
32-
"vue-eslint-parser": "^8.0.0"
32+
"vue-eslint-parser": "^8.2.0"
3333
},
3434
"devDependencies": {
3535
"@types/aria-query": "^5.0.0",
36-
"@types/eslint-scope": "^3.7.0",
36+
"@types/eslint-scope": "^3.7.2",
3737
"@types/eslint-visitor-keys": "^1.0.0",
3838
"@types/jest": "^27.0.0",
39-
"@types/node": "^16.10.9",
40-
"@typescript-eslint/eslint-plugin": "^5.0.0",
41-
"@typescript-eslint/parser": "^5.0.0",
42-
"eslint": "^8.0.0",
43-
"eslint-plugin-eslint-plugin": "^4.0.1",
44-
"husky": "^7.0.0",
45-
"jest": "^27.2.5",
39+
"@types/node": "^17.0.14",
40+
"@typescript-eslint/eslint-plugin": "^5.10.2",
41+
"@typescript-eslint/parser": "^5.10.2",
42+
"eslint": "^8.8.0",
43+
"eslint-plugin-eslint-plugin": "^4.1.0",
44+
"husky": "^8.0.1",
45+
"jest": "^27.4.5",
4646
"prettier": "^2.1.1",
47-
"pretty-quick": "^3.0.0",
48-
"ts-jest": "^27.0.1",
47+
"pretty-quick": "^3.1.3",
48+
"ts-jest": "^27.1.2",
4949
"ts-node": "^10.3.0",
50-
"typescript": "^4.4.4"
50+
"typescript": "^4.5.4"
5151
},
5252
"eslintConfig": {
5353
"env": {

Diff for: src/rules/accessible-emoji.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ import {
1212

1313
const rule: Rule.RuleModule = {
1414
meta: {
15+
type: "problem",
1516
docs: {
1617
url: makeDocsURL("accessible-emoji")
1718
},
1819
deprecated: true,
1920
messages: {
2021
default: `Emojis should be wrapped in <span>, have role="img", and have an accessible description with aria-label or aria-labelledby.`
21-
}
22+
},
23+
schema: []
2224
},
2325
create(context) {
2426
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/alt-text.ts

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const ruleByElement: RuleByElement = {
6262

6363
const rule: Rule.RuleModule = {
6464
meta: {
65+
type: "problem",
6566
docs: {
6667
url: makeDocsURL("alt-text")
6768
},

Diff for: src/rules/anchor-has-content.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111

1212
const rule: Rule.RuleModule = {
1313
meta: {
14+
type: "problem",
1415
docs: {
1516
url: makeDocsURL("anchor-has-content")
1617
},

Diff for: src/rules/aria-props.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ import {
99

1010
const rule: Rule.RuleModule = {
1111
meta: {
12+
type: "problem",
1213
docs: {
1314
url: makeDocsURL("aria-props")
1415
},
1516
messages: {
1617
default: "{{name}} This attribute is an invalid ARIA attribute."
17-
}
18+
},
19+
schema: []
1820
},
1921
create(context) {
2022
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/aria-role.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function isValidRole(value: any) {
1616

1717
const rule: Rule.RuleModule = {
1818
meta: {
19+
type: "problem",
1920
docs: {
2021
url: makeDocsURL("aria-role")
2122
},

Diff for: src/rules/aria-unsupported-elements.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import {
1010

1111
const rule: Rule.RuleModule = {
1212
meta: {
13+
type: "problem",
1314
docs: {
1415
url: makeDocsURL("aria-unsupported-elements")
1516
},
1617
messages: {
1718
default: `This element does not support ARIA roles, states, and properties. Try removing the "{{name}}" attribute.`
18-
}
19+
},
20+
schema: []
1921
},
2022
create(context) {
2123
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/click-events-have-key-events.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ function isCustomComponent(node: AST.VElement) {
3030

3131
const rule: Rule.RuleModule = {
3232
meta: {
33+
type: "problem",
3334
docs: {
3435
url: makeDocsURL("click-events-have-key-events")
3536
},
3637
messages: {
3738
default:
3839
"Visible, non-interactive elements with click handlers must have at least one keyboard listener."
39-
}
40+
},
41+
schema: []
4042
},
4143
create(context) {
4244
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/form-control-has-label.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ function hasLabelElement(node: AST.VElement, options: FormControlHasLabelOptions
3838

3939
const rule: Rule.RuleModule = {
4040
meta: {
41+
type: "problem",
4142
docs: {
42-
url: makeDocsURL("form-has-label")
43+
url: makeDocsURL("form-control-has-label")
4344
},
4445
messages: {
4546
default:

Diff for: src/rules/heading-has-content.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
1212

1313
const rule: Rule.RuleModule = {
1414
meta: {
15+
type: "problem",
1516
docs: {
1617
url: makeDocsURL("heading-has-content")
1718
},

Diff for: src/rules/iframe-has-title.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import {
1010

1111
const rule: Rule.RuleModule = {
1212
meta: {
13+
type: "problem",
1314
docs: {
1415
url: makeDocsURL("iframe-has-title")
1516
},
1617
messages: {
1718
default: "<iframe> elements must have a unique title property."
18-
}
19+
},
20+
schema: []
1921
},
2022
create(context) {
2123
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/interactive-supports-focus.ts

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ interface InteractiveSupportsFocus extends Rule.RuleModule {
102102

103103
const rule: InteractiveSupportsFocus = {
104104
meta: {
105+
type: "problem",
105106
docs: {
106107
url: makeDocsURL("interactive-supports-focus")
107108
},

Diff for: src/rules/label-has-for.ts

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function isValidLabel(
7373

7474
const rule: Rule.RuleModule = {
7575
meta: {
76+
type: "problem",
7677
docs: {
7778
url: makeDocsURL("label-has-for")
7879
},

Diff for: src/rules/media-has-caption.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function isCaptionsTrackElement(
2222

2323
const rule: Rule.RuleModule = {
2424
meta: {
25+
type: "problem",
2526
docs: {
2627
url: makeDocsURL("media-has-caption")
2728
},

Diff for: src/rules/mouse-events-have-key-events.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88

99
const rule: Rule.RuleModule = {
1010
meta: {
11+
type: "problem",
1112
docs: {
1213
url: makeDocsURL("mouse-events-have-key-events")
1314
},
@@ -16,7 +17,8 @@ const rule: Rule.RuleModule = {
1617
"@mouseover, @mouseenter, or @hover must be accompanied by @focusin or @focus for accessibility.",
1718
mouseOut:
1819
"@mouseout or @mouseleave must be accompanied by @focusout or @blur for accessibility."
19-
}
20+
},
21+
schema: []
2022
},
2123
create(context) {
2224
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/no-access-key.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import {
88

99
const rule: Rule.RuleModule = {
1010
meta: {
11+
type: "problem",
1112
docs: {
1213
url: makeDocsURL("no-access-key")
1314
},
1415
messages: {
1516
default:
1617
"No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard comments used by screenreader and keyboard only users create a11y complications."
17-
}
18+
},
19+
schema: []
1820
},
1921
create(context) {
2022
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/no-autofocus.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010

1111
const rule: Rule.RuleModule = {
1212
meta: {
13+
type: "problem",
1314
docs: {
1415
url: makeDocsURL("no-autofocus")
1516
},

Diff for: src/rules/no-distracting-elements.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const defaultElements = ["marquee", "blink"];
1111

1212
const rule: Rule.RuleModule = {
1313
meta: {
14+
type: "problem",
1415
docs: {
1516
url: makeDocsURL("no-distracting-elements")
1617
},

Diff for: src/rules/no-onchange.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import {
99

1010
const rule: Rule.RuleModule = {
1111
meta: {
12+
type: "problem",
1213
docs: {
1314
url: makeDocsURL("no-onchange")
1415
},
1516
messages: {
1617
default:
1718
"@blur must be used instead of @change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users."
18-
}
19+
},
20+
schema: []
1921
},
2022
create(context) {
2123
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/no-redundant-roles.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function getImplicitRoleSet(node: AST.VElement): any[] | null {
2525

2626
const rule: Rule.RuleModule = {
2727
meta: {
28+
type: "problem",
2829
docs: {
2930
url: makeDocsURL("no-redundant-roles")
3031
},

Diff for: src/rules/role-has-required-aria-props.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ function isAriaRoleDefinitionKey(role: any): role is ARIARoleDefintionKey {
2020

2121
const rule: Rule.RuleModule = {
2222
meta: {
23+
type: "problem",
2324
docs: {
2425
url: makeDocsURL("role-has-required-aria-props")
2526
},
2627
messages: {
2728
default: `Elements with the ARIA role "{{role}}" must have the following attributes defined: {{attributes}}`
28-
}
29+
},
30+
schema: []
2931
},
3032
create(context) {
3133
return defineTemplateBodyVisitor(context, {

Diff for: src/rules/tabindex-no-positive.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@ import {
88

99
const rule: Rule.RuleModule = {
1010
meta: {
11+
type: "problem",
1112
docs: {
1213
url: makeDocsURL("tabindex-no-positive")
1314
},
1415
messages: {
1516
default: "Avoid positive integer values for tabindex."
16-
}
17+
},
18+
schema: []
1719
},
1820
create(context) {
1921
return defineTemplateBodyVisitor(context, {
2022
VElement(node) {
2123
const tabIndex = getLiteralAttributeValue(node, "tabindex");
2224

23-
if (tabIndex && +tabIndex > 0) {
25+
if (
26+
(typeof tabIndex === "string" || typeof tabIndex === "number") &&
27+
+tabIndex > 0
28+
) {
2429
context.report({ node: node as any, messageId: "default" });
2530
}
2631
}

0 commit comments

Comments
 (0)