Skip to content

Commit

Permalink
Infrastructure: Upgrade ESLint to v8 and plugins (#2080)
Browse files Browse the repository at this point in the history
* Infrastructure: Upgrade to ESLint 8

Swap to newer babel-eslint parser version to support parsing scripts

* Infrastructure: Upgrade eslint-plugin-ava

* Infrastructure: Upgrade eslint-plugin-jsdoc

* Infrastructure: Upgrade ESLint Prettier plugins

Ran autofix for new formatting
  • Loading branch information
nschonni authored Nov 2, 2021
1 parent 4698a6d commit cea8a19
Show file tree
Hide file tree
Showing 8 changed files with 556 additions and 1,208 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
"env": {
"node": true
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"rules": {
"no-console": 0
}
Expand Down
1,650 changes: 494 additions & 1,156 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@
},
"homepage": "https://github.com/w3c/aria-practices#readme",
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/eslint-parser": "^7.16.0",
"ava": "^3.15.0",
"babel-eslint": "^10.1.0",
"cheerio": "^1.0.0-rc.5",
"cspell": "^5.8.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-ava": "^11.0.0",
"eslint-plugin-jsdoc": "^36.0.7",
"eslint-plugin-prettier": "^3.3.1",
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ava": "^13.1.0",
"eslint-plugin-jsdoc": "^37.0.3",
"eslint-plugin-prettier": "^4.0.0",
"geckodriver": "^1.22.1",
"glob": "^7.1.6",
"htmlhint": "^0.14.2",
Expand All @@ -53,7 +54,7 @@
"lint-staged": "^10.5.4",
"npm-merge-driver": "^2.3.6",
"pinst": "^2.1.4",
"prettier": "^2.2.1",
"prettier": "^2.4.1",
"selenium-webdriver": "^4.0.0-beta.1",
"stylelint": "^13.11.0",
"stylelint-config-prettier": "^8.0.2",
Expand Down
8 changes: 6 additions & 2 deletions test/tests/combobox_autocomplete-both.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,9 @@ ariaTest(

// Confirm that there are 56 options visible
t.is(
await (await t.context.queryElements(t, ex.optionsSelector)).length,
await (
await t.context.queryElements(t, ex.optionsSelector)
).length,
56,
'key press "ARROW_DOWN" should result in all options being visible'
);
Expand Down Expand Up @@ -730,7 +732,9 @@ ariaTest(

// Confirm that there are 9 options visible
t.is(
await (await t.context.queryElements(t, ex.optionsSelector)).length,
await (
await t.context.queryElements(t, ex.optionsSelector)
).length,
9,
'key press "ARROW_DOWN" should result in 9 options being visible'
);
Expand Down
8 changes: 6 additions & 2 deletions test/tests/combobox_autocomplete-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@ ariaTest(

// Confirm that there are 56 options visible
t.is(
await (await t.context.queryElements(t, ex.optionsSelector)).length,
await (
await t.context.queryElements(t, ex.optionsSelector)
).length,
56,
'key press "ARROW_DOWN" should result in all options being visible'
);
Expand Down Expand Up @@ -756,7 +758,9 @@ ariaTest(

// Confirm that there are 9 options visible
t.is(
await (await t.context.queryElements(t, ex.optionsSelector)).length,
await (
await t.context.queryElements(t, ex.optionsSelector)
).length,
9,
'key press "ARROW_DOWN" should result in 9 options being visible'
);
Expand Down
30 changes: 15 additions & 15 deletions test/tests/combobox_datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ ariaTest(
'textbox-aria-expanded-true',
async (t) => {
// Open dialog box
await (await t.context.queryElement(t, ex.comboboxSelector)).sendKeys(
Key.ARROW_DOWN
);
await (
await t.context.queryElement(t, ex.comboboxSelector)
).sendKeys(Key.ARROW_DOWN);
await assertAttributeValues(
t,
ex.comboboxSelector,
Expand Down Expand Up @@ -404,9 +404,9 @@ ariaTest(
await el.sendKeys(Key.ESCAPE);

t.is(
await (await t.context.queryElement(t, ex.dialogSelector)).getCssValue(
'display'
),
await (
await t.context.queryElement(t, ex.dialogSelector)
).getCssValue('display'),
'none',
'After sending ESC to element "' +
ex.allFocusableElementsInDialog[i] +
Expand All @@ -431,9 +431,9 @@ ariaTest(
exampleFile,
'month-year-button-space-return',
async (t) => {
await (await t.context.queryElement(t, ex.buttonSelector)).sendKeys(
Key.ENTER
);
await (
await t.context.queryElement(t, ex.buttonSelector)
).sendKeys(Key.ENTER);

let monthYear = await t.context.queryElement(t, ex.monthYear);
let originalMonthYear = await monthYear.getText();
Expand Down Expand Up @@ -471,9 +471,9 @@ ariaTest(
exampleFile,
'dialog-tab',
async (t) => {
await (await t.context.queryElement(t, ex.buttonSelector)).sendKeys(
Key.ENTER
);
await (
await t.context.queryElement(t, ex.buttonSelector)
).sendKeys(Key.ENTER);

for (let itemSelector of ex.allFocusableElementsInDialog) {
t.true(
Expand All @@ -499,9 +499,9 @@ ariaTest(
async (t) => {
t.plan(7);

await (await t.context.queryElement(t, ex.buttonSelector)).sendKeys(
Key.ENTER
);
await (
await t.context.queryElement(t, ex.buttonSelector)
).sendKeys(Key.ENTER);

await (
await t.context.queryElement(t, ex.allFocusableElementsInDialog[0])
Expand Down
6 changes: 2 additions & 4 deletions test/tests/grid_LayoutGrids.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,7 @@ ariaTest(
const lastElementInFirstRowText = {
ex1: 'SVG 2 Specification',
ex2: 'X',
ex3:
'WAI-ARIA, the Accessible Rich Internet Applications Suite, defines a way to make Web content and Web applications more accessible to people with disabilities.',
ex3: 'WAI-ARIA, the Accessible Rich Internet Applications Suite, defines a way to make Web content and Web applications more accessible to people with disabilities.',
};

for (let [exId, ex] of Object.entries(pageExamples)) {
Expand Down Expand Up @@ -994,8 +993,7 @@ ariaTest(
const lastElementInFirstRowText = {
ex1: 'SVG 2 Specification',
ex2: 'X',
ex3:
'Jan 3, 2014 - NVDA 2 supports all landmarks except it will not support navigation to “application”; Window Eyes as of V.7 does not support ARIA landmarks.',
ex3: 'Jan 3, 2014 - NVDA 2 supports all landmarks except it will not support navigation to “application”; Window Eyes as of V.7 does not support ARIA landmarks.',
};

for (let [exId, ex] of Object.entries(pageExamples)) {
Expand Down
42 changes: 21 additions & 21 deletions test/tests/listbox_rearrangeable.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ ariaTest(
index
);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
index
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[index].getAttribute('aria-selected'),
'false',
'aria-selected is false when moving between options with down arrow in example 2'
);
Expand All @@ -239,9 +239,9 @@ ariaTest(
lastOption
);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
lastOption
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[lastOption].getAttribute('aria-selected'),
'false',
'aria-selected is false when moving between options with down arrow in example 2'
);
Expand Down Expand Up @@ -300,9 +300,9 @@ ariaTest(
index
);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
index
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[index].getAttribute('aria-selected'),
'false',
'aria-selected is false when moving between options with down arrow in example 2'
);
Expand Down Expand Up @@ -435,9 +435,9 @@ ariaTest('end moves focus and selects', exampleFile, 'key-end', async (t) => {
lastOption
);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
lastOption
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[lastOption].getAttribute('aria-selected'),
'false',
'aria-selected is false when moving between options with END in example 2'
);
Expand All @@ -452,9 +452,9 @@ ariaTest('end moves focus and selects', exampleFile, 'key-end', async (t) => {
lastOption
);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
lastOption
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[lastOption].getAttribute('aria-selected'),
'false',
'aria-selected is false when moving between options with END in example 2'
);
Expand All @@ -472,9 +472,9 @@ ariaTest('key space selects', exampleFile, 'key-space', async (t) => {
for (let index = 0; index < options.length - 1; index++) {
await listbox.sendKeys(Key.ARROW_DOWN, Key.SPACE);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
index + 1
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[index + 1].getAttribute('aria-selected'),
'true',
'aria-selected is true when sending space key to item at index: ' +
(index + 1)
Expand All @@ -484,9 +484,9 @@ ariaTest('key space selects', exampleFile, 'key-space', async (t) => {
for (let index = options.length - 1; index >= 0; index--) {
await listbox.sendKeys(Key.SPACE);
t.is(
await (await t.context.queryElements(t, ex[2].optionSelector))[
index
].getAttribute('aria-selected'),
await (
await t.context.queryElements(t, ex[2].optionSelector)
)[index].getAttribute('aria-selected'),
'false',
'aria-selected is true when sending space key to item at index: ' + index
);
Expand Down

0 comments on commit cea8a19

Please sign in to comment.