Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no-access-key wording and grammar #800

Merged
merged 7 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/node-4+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
Expand Down Expand Up @@ -73,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;

Expand Down
7 changes: 2 additions & 5 deletions __mocks__/genInteractives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down
13 changes: 7 additions & 6 deletions __tests__/src/rules/autocomplete-valid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ ruleTester.run('autocomplete-valid', rule, {
{ code: '<input type="text" autocomplete={autocompl || "name"} />;' },
{ code: '<input type="text" autocomplete={autocompl || "foo"} />;' },
{ code: '<Foo autocomplete="bar"></Foo>;' },

// PASSED "autocomplete-appropriate"
// see also: https://github.com/dequelabs/axe-core/issues/2912
{ code: '<input type="date" autocomplete="email" />;', errors: inappropriateAutocomplete },
{ code: '<input type="number" autocomplete="url" />;', errors: inappropriateAutocomplete },
{ code: '<input type="month" autocomplete="tel" />;', errors: inappropriateAutocomplete },
{ code: '<Foo type="month" autocomplete="tel"></Foo>;', errors: inappropriateAutocomplete, options: [{ inputComponents: ['Foo'] }] },
].map(parserOptionsMapper),
invalid: [
// FAILED "autocomplete-valid"
Expand All @@ -55,11 +62,5 @@ ruleTester.run('autocomplete-valid', rule, {
{ code: '<input type="text" autocomplete="home url" />;', errors: invalidAutocomplete },
{ code: '<Bar autocomplete="baz"></Bar>;', errors: invalidAutocomplete, options: [{ inputComponents: ['Bar'] }] },
{ code: '<input type={isEmail ? "email" : "text"} autocomplete="none" />;', errors: invalidAutocomplete },

// FAILED "autocomplete-appropriate"
{ code: '<input type="date" autocomplete="email" />;', errors: inappropriateAutocomplete },
{ code: '<input type="number" autocomplete="url" />;', errors: inappropriateAutocomplete },
{ code: '<input type="month" autocomplete="tel" />;', errors: inappropriateAutocomplete },
{ code: '<Foo type="month" autocomplete="tel"></Foo>;', errors: inappropriateAutocomplete, options: [{ inputComponents: ['Foo'] }] },
].map(parserOptionsMapper),
});
2 changes: 1 addition & 1 deletion __tests__/src/rules/no-access-key-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-access-key.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-access-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down