From d57887c5dac15e5c5ca5b6fe8cd75b682af433d4 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 25 Jun 2021 11:30:50 -0700 Subject: [PATCH 1/7] [Tests] ensure all tests run --- .github/workflows/node-4+.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node-4+.yml b/.github/workflows/node-4+.yml index 619fb3b21..42f249baa 100644 --- a/.github/workflows/node-4+.yml +++ b/.github/workflows/node-4+.yml @@ -21,6 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: ${{ fromJson(needs.matrix.outputs.latest) }} eslint: From 8830902b416849317a52f87bbbc84a38d420845d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 25 Jun 2021 11:41:48 -0700 Subject: [PATCH 2/7] [Tests] fix eslint < 7 not understanding `import type` --- __mocks__/genInteractives.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/__mocks__/genInteractives.js b/__mocks__/genInteractives.js index 4c57fc838..927321b75 100644 --- a/__mocks__/genInteractives.js +++ b/__mocks__/genInteractives.js @@ -4,11 +4,8 @@ import { dom, roles } from 'aria-query'; import includes from 'array-includes'; -import JSXAttributeMock from './JSXAttributeMock'; -import JSXElementMock from './JSXElementMock'; - -import type { JSXElementMockType } from './JSXElementMock'; -import type { JSXAttributeMockType } from './JSXAttributeMock'; +import JSXAttributeMock, { JSXAttributeMockType } from './JSXAttributeMock'; +import JSXElementMock, { JSXElementMockType } from './JSXElementMock'; const domElements = [...dom.keys()]; const roleNames = [...roles.keys()]; From 0c1c5878d543b1e8381213715a661ddb14ce13dd Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jul 2021 14:20:46 -0700 Subject: [PATCH 3/7] [Tests] `autocomplete-valid`: move some failed tests to passing See https://github.com/dequelabs/axe-core/issues/2912 --- __tests__/src/rules/autocomplete-valid-test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/__tests__/src/rules/autocomplete-valid-test.js b/__tests__/src/rules/autocomplete-valid-test.js index 020c583f1..e89b9ce64 100644 --- a/__tests__/src/rules/autocomplete-valid-test.js +++ b/__tests__/src/rules/autocomplete-valid-test.js @@ -46,6 +46,13 @@ ruleTester.run('autocomplete-valid', rule, { { code: ';' }, { code: ';' }, { code: ';' }, + + // PASSED "autocomplete-appropriate" + // see also: https://github.com/dequelabs/axe-core/issues/2912 + { code: ';', errors: inappropriateAutocomplete }, + { code: ';', errors: inappropriateAutocomplete }, + { code: ';', errors: inappropriateAutocomplete }, + { code: ';', errors: inappropriateAutocomplete, options: [{ inputComponents: ['Foo'] }] }, ].map(parserOptionsMapper), invalid: [ // FAILED "autocomplete-valid" @@ -55,11 +62,5 @@ ruleTester.run('autocomplete-valid', rule, { { code: ';', errors: invalidAutocomplete }, { code: ';', errors: invalidAutocomplete, options: [{ inputComponents: ['Bar'] }] }, { code: ';', errors: invalidAutocomplete }, - - // FAILED "autocomplete-appropriate" - { code: ';', errors: inappropriateAutocomplete }, - { code: ';', errors: inappropriateAutocomplete }, - { code: ';', errors: inappropriateAutocomplete }, - { code: ';', errors: inappropriateAutocomplete, options: [{ inputComponents: ['Foo'] }] }, ].map(parserOptionsMapper), }); From 2a9ab7108f1a9419d547f679483e5ed5f6721419 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jul 2021 15:57:10 -0700 Subject: [PATCH 4/7] [Tests] delete `src/util/getComputedRole-test.js` test in node 6 Due to `import type` syntax not working --- .github/workflows/node-4+.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node-4+.yml b/.github/workflows/node-4+.yml index 42f249baa..493f6d955 100644 --- a/.github/workflows/node-4+.yml +++ b/.github/workflows/node-4+.yml @@ -74,6 +74,8 @@ jobs: after_install: npm uninstall --no-save eslint-config-airbnb-base && NPM_CONFIG_LEGACY_PEER_DEPS=true npm install --no-save "eslint@${{ matrix.eslint }}" node-version: ${{ matrix.node-version }} skip-ls-check: true + - run: rm __tests__/src/util/getComputedRole-test.js + if: ${{ matrix.node-version < 7 }} - run: npm run test:ci - run: bash <(curl -s https://codecov.io/bash) -f coverage/*.json; From 79a35d44d632d645ddd26363b0dcac37f95397df Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jul 2021 13:23:35 -0700 Subject: [PATCH 5/7] [Deps] update `@babel/runtime`, `axe-core`, `damerau-levenshtein` --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6d9691be3..e2ca3f36a 100644 --- a/package.json +++ b/package.json @@ -59,13 +59,13 @@ }, "license": "MIT", "dependencies": { - "@babel/runtime": "^7.13.10", + "@babel/runtime": "^7.14.6", "aria-query": "^4.2.2", "array-includes": "^3.1.3", "ast-types-flow": "^0.0.7", - "axe-core": "^4.1.3", + "axe-core": "^4.3.1", "axobject-query": "^2.2.0", - "damerau-levenshtein": "^1.0.6", + "damerau-levenshtein": "^1.0.7", "emoji-regex": "^9.2.2", "has": "^1.0.3", "jsx-ast-utils": "^3.2.0", From 6cf7ac0203e4a6105d12be21004f67a49f0a4732 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jul 2021 13:26:01 -0700 Subject: [PATCH 6/7] [Dev Deps] update `@babel/cli`, `@babel/core`, `@babel/plugin-transform-flow-strip-types`, `aud`, `eslint-plugin-flowtype`, `eslint-plugin-import` --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e2ca3f36a..32722fc0d 100644 --- a/package.json +++ b/package.json @@ -31,17 +31,17 @@ "jest": "jest --coverage __tests__/**/*" }, "devDependencies": { - "@babel/cli": "^7.13.14", - "@babel/core": "^7.13.14", - "@babel/plugin-transform-flow-strip-types": "^7.13.0", - "aud": "^1.1.4", + "@babel/cli": "^7.14.5", + "@babel/core": "^7.14.6", + "@babel/plugin-transform-flow-strip-types": "^7.14.5", + "aud": "^1.1.5", "babel-eslint": "^10.1.0", "babel-jest": "^24.9.0", "babel-preset-airbnb": "^5.0.0", "eslint": "^3 || ^4 || ^5 || ^6 || ^7", "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-flowtype": "^5.4.0", - "eslint-plugin-import": "^2.22.1", + "eslint-plugin-flowtype": "^5.8.0", + "eslint-plugin-import": "^2.23.4", "estraverse": "^5.2.0", "expect": "^24.9.0", "flow-bin": "^0.147.0", From 952af253fc5bd5ec83067f909c49dc72667b2654 Mon Sep 17 00:00:00 2001 From: Brad Adams Date: Thu, 17 Jun 2021 00:13:21 +0200 Subject: [PATCH 7/7] [Fix] `no-access-key`: Fix wording and grammar Fixes #801. --- __tests__/src/rules/no-access-key-test.js | 2 +- docs/rules/no-access-key.md | 2 +- src/rules/no-access-key.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/src/rules/no-access-key-test.js b/__tests__/src/rules/no-access-key-test.js index ea2ee66b9..32f035b21 100644 --- a/__tests__/src/rules/no-access-key-test.js +++ b/__tests__/src/rules/no-access-key-test.js @@ -19,7 +19,7 @@ import rule from '../../../src/rules/no-access-key'; const ruleTester = new RuleTester(); const expectedError = { - message: 'No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard comments used by screenreader and keyboard only users create a11y complications.', + message: 'No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreaders and keyboard-only users create a11y complications.', type: 'JSXOpeningElement', }; diff --git a/docs/rules/no-access-key.md b/docs/rules/no-access-key.md index b3c18500f..80ddc98cb 100644 --- a/docs/rules/no-access-key.md +++ b/docs/rules/no-access-key.md @@ -1,6 +1,6 @@ # no-access-key -Enforce no accessKey prop on element. Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreader and keyboard only users create accessibility complications so to avoid complications, access keys should not be used. +Enforce no accessKey prop on element. Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreaders and keyboard-only users create accessibility complications so to avoid complications, access keys should not be used. ### References 1. [WebAIM](http://webaim.org/techniques/keyboard/accesskey#spec) diff --git a/src/rules/no-access-key.js b/src/rules/no-access-key.js index 854c11382..ac089cc75 100644 --- a/src/rules/no-access-key.js +++ b/src/rules/no-access-key.js @@ -10,7 +10,7 @@ import { getProp, getPropValue } from 'jsx-ast-utils'; import { generateObjSchema } from '../util/schemas'; -const errorMessage = 'No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard comments used by screenreader and keyboard only users create a11y complications.'; +const errorMessage = 'No access key attribute allowed. Inconsistencies between keyboard shortcuts and keyboard commands used by screenreaders and keyboard-only users create a11y complications.'; const schema = generateObjSchema();