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

Infrastructure: Fix previously excluded ESLint issues #1610

Merged
merged 25 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
24a4fed
fix: Remove unused variables in tests
nschonni Nov 10, 2020
7d1be89
fix: no undefined in test files
nschonni Nov 10, 2020
a55efa7
fix: ESLint errors in respec-config
nschonni Nov 11, 2020
546b283
fix: ESLint in treeview
nschonni Nov 11, 2020
678fe61
fix: ESLint in toolbar files
nschonni Nov 11, 2020
07b7581
fix: Unsued vars in tabs
nschonni Nov 11, 2020
43ead02
fix: unused vars in slider
nschonni Nov 11, 2020
2138d0f
fix: Unused vars in meter
nschonni Nov 11, 2020
6950b66
fix: ESLint issues in menubar
nschonni Nov 11, 2020
04670f8
fix: ESLint menu-button files
nschonni Nov 11, 2020
2e6e873
fix: ESlint listbox examples
nschonni Nov 11, 2020
7a4e69f
fix: Ignore exported link helper
nschonni Nov 11, 2020
88cfa74
fix: ESLint in landmarks examples
nschonni Nov 11, 2020
c9c80bc
fix: ESLint errors in supporting example JS
nschonni Nov 11, 2020
1287927
fix: ESLint in grid examples
nschonni Nov 11, 2020
f1ff5d8
fix: ESLint in feed example
nschonni Nov 11, 2020
84f7985
fix: ESLint in disclousure example
nschonni Nov 11, 2020
fb7b2d7
fix: ESLint dialog modal example
nschonni Nov 11, 2020
7959735
fix: ESLint combobox examples
nschonni Nov 11, 2020
ea40ad5
fix: ESLint in checkbox examples
nschonni Nov 11, 2020
debbd05
fix: ESLint in alert example
nschonni Nov 11, 2020
8e5251b
fix: ESLint accordion
nschonni Nov 11, 2020
5a2cda0
chore: Remove passing no-console
nschonni Nov 11, 2020
87a85f0
chore: Allow console in Node scripts
nschonni Dec 29, 2020
d055ea4
chore: Disallow unused eslint-disable directives
nschonni Dec 29, 2020
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
105 changes: 0 additions & 105 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,111 +39,6 @@
"rules": {
"no-console": 0
}
},
{
"files": [
"examples/accordion/js/accordion.js",
"examples/alert/js/alert.js",
"examples/checkbox/checkbox-1/js/checkbox.js",
"examples/checkbox/checkbox-2/js/checkboxMixed.js",
"examples/checkbox/checkbox-2/js/controlledCheckbox.js",
"examples/combobox/js/combobox-autocomplete.js",
"examples/combobox/js/combobox-datepicker.js",
"examples/combobox/js/grid-combo-example.js",
"examples/combobox/js/grid-combo.js",
"examples/dialog-modal/js/alertdialog.js",
"examples/dialog-modal/js/dialog.js",
"examples/disclosure/js/disclosureButton.js",
"examples/disclosure/js/disclosureMenu.js",
"examples/grid/js/dataGrid.js",
"examples/grid/js/dataGrids.js",
"examples/grid/js/layoutGrids.js",
"examples/js/examples.js",
"examples/landmarks/js/bootstrap-accessibility-2.js",
"examples/landmarks/js/show.js",
"examples/link/js/link.js",
"examples/listbox/js/listbox-collapsible.js",
"examples/listbox/js/listbox-scrollable.js",
"examples/listbox/js/listbox.js",
"examples/menu-button/js/menu-button-actions-active-descendant.js",
"examples/menu-button/js/menu-button-actions.js",
"examples/menu-button/js/menu-button-links.js",
"examples/menubar/js/menubar-editor.js",
"examples/menubar/js/menubar-navigation.js",
"examples/meter/js/meter.js",
"examples/slider/js/multithumb-slider.js",
"examples/slider/js/slider.js",
"examples/slider/js/text-slider.js",
"examples/slider/js/vertical-slider.js",
"examples/tabs/tabs-2/js/tabs.js",
"examples/toolbar/js/FontMenu.js",
"examples/toolbar/js/FontMenuButton.js",
"examples/toolbar/js/FontMenuItem.js",
"examples/toolbar/js/FormatToolbar.js",
"examples/toolbar/js/FormatToolbarItem.js",
"examples/treeview/treeview-1/js/treeitem.js",
"examples/treeview/treeview-2/js/treeitemLinks.js",
"respec-config.js",
"test/index.js",
"test/tests/accordion_accordion.js",
"test/tests/combobox_datepicker.js",
"test/tests/combobox_select-only.js",
"test/tests/dialog-modal_datepicker.js",
"test/tests/grid_LayoutGrids.js",
"test/tests/grid_dataGrids.js",
"test/tests/menu-button_actions.js",
"test/tests/menu-button_actions-active-descendant.js",
"test/tests/menubar_menubar-editor.js",
"test/tests/menubar_menubar-navigation.js",
"test/tests/slider_slider-2.js",
"test/tests/tabs_tabs-1.js",
"test/tests/tabs_tabs-2.js",
"test/util/assertHasFocus.js",
"test/tests/toolbar_toolbar.js",
"test/tests/treegrid_treegrid-1.js",
"test/tests/treeview_treeview-1a.js",
"test/tests/treeview_treeview-1b.js",
"test/tests/treeview_treeview-2a.js",
"test/tests/treeview_treeview-2b.js",
"test/util/assertAriaDescribedby.js",
"test/util/assertDotValue.js",
"test/util/report.js"
],
"rules": {
"no-unused-vars": 0
}
},
{
"files": [
"examples/checkbox/checkbox-2/js/checkboxMixed.js",
"examples/combobox/js/grid-combo-example.js",
"examples/combobox/js/grid-combo.js",
"examples/dialog-modal/js/alertdialog.js",
"examples/feed/js/main.js",
"examples/grid/js/dataGrids.js",
"examples/js/app.js",
"examples/landmarks/js/bootstrap-accessibility-2.js",
"examples/landmarks/js/show.js",
"examples/landmarks/js/tabs.js",
"examples/listbox/js/listbox-rearrangeable.js",
"examples/listbox/js/listbox-scrollable.js",
"examples/menubar/js/menubar-editor.js",
"examples/toolbar/js/FontMenu.js",
"examples/toolbar/js/FontMenuButton.js",
"examples/toolbar/js/FormatToolbar.js",
"examples/treeview/treeview-1/js/tree.js",
"examples/treeview/treeview-2/js/treeLinks.js",
"respec-config.js",
"test/tests/link_link.js",
"test/tests/menu-button_actions-active-descendant.js",
"test/tests/menu-button_actions.js",
"test/tests/menu-button_links.js",
"test/util/assertTabOrder.js",
"test/util/force-serial.js"
],
"rules": {
"no-undef": 0
}
}
]
}
12 changes: 2 additions & 10 deletions examples/accordion/js/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ Array.prototype.slice
var triggers = Array.prototype.slice.call(
accordion.querySelectorAll('.Accordion-trigger')
);
var panels = Array.prototype.slice.call(
accordion.querySelectorAll('.Accordion-panel')
);

accordion.addEventListener('click', function (event) {
var target = event.target;
Expand Down Expand Up @@ -78,11 +75,6 @@ Array.prototype.slice
var target = event.target;
var key = event.which.toString();

var isExpanded = target.getAttribute('aria-expanded') == 'true';
var allowToggle = allowMultiple
? allowMultiple
: accordion.hasAttribute('data-allow-toggle');

// 33 = Page Up, 34 = Page Down
var ctrlModifier = event.ctrlKey && key.match(/33|34/);

Expand Down Expand Up @@ -120,11 +112,11 @@ Array.prototype.slice
accordion
.querySelectorAll('.Accordion-trigger')
.forEach(function (trigger) {
trigger.addEventListener('focus', function (event) {
trigger.addEventListener('focus', function () {
accordion.classList.add('focus');
});

trigger.addEventListener('blur', function (event) {
trigger.addEventListener('blur', function () {
accordion.classList.remove('focus');
});
});
Expand Down
2 changes: 1 addition & 1 deletion examples/alert/js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ window.addEventListener('load', function () {
*
*/

function addAlert(event) {
function addAlert() {
var example = document.getElementById('example');
var template = document.getElementById('alert-template').innerHTML;

Expand Down
6 changes: 3 additions & 3 deletions examples/checkbox/checkbox-1/js/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ Checkbox.prototype.handleKeydown = function (event) {
}
};

Checkbox.prototype.handleClick = function (event) {
Checkbox.prototype.handleClick = function () {
this.toggleCheckbox();
};

Checkbox.prototype.handleFocus = function (event) {
Checkbox.prototype.handleFocus = function () {
this.domNode.classList.add('focus');
};

Checkbox.prototype.handleBlur = function (event) {
Checkbox.prototype.handleBlur = function () {
this.domNode.classList.remove('focus');
};
8 changes: 5 additions & 3 deletions examples/checkbox/checkbox-2/js/checkboxMixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* for a menu of links
*/

/* global ControlledCheckbox */

'use strict';

/*
Expand Down Expand Up @@ -136,14 +138,14 @@ CheckboxMixed.prototype.handleKeydown = function (event) {
}
};

CheckboxMixed.prototype.handleClick = function (event) {
CheckboxMixed.prototype.handleClick = function () {
this.toggleCheckboxMixed();
};

CheckboxMixed.prototype.handleFocus = function (event) {
CheckboxMixed.prototype.handleFocus = function () {
this.domNode.classList.add('focus');
};

CheckboxMixed.prototype.handleBlur = function (event) {
CheckboxMixed.prototype.handleBlur = function () {
this.domNode.classList.remove('focus');
};
6 changes: 3 additions & 3 deletions examples/checkbox/checkbox-2/js/controlledCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ ControlledCheckbox.prototype.setChecked = function (value) {

/* EVENT HANDLERS */

ControlledCheckbox.prototype.handleChange = function (event) {
ControlledCheckbox.prototype.handleChange = function () {
this.controller.updateCheckboxMixed();
};

ControlledCheckbox.prototype.handleKeyup = function (event) {
ControlledCheckbox.prototype.handleKeyup = function () {
this.lastState = this.isChecked();
};

ControlledCheckbox.prototype.handleClick = function (event) {
ControlledCheckbox.prototype.handleClick = function () {
this.lastState = this.isChecked();
};
17 changes: 8 additions & 9 deletions examples/combobox/js/combobox-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ class ComboboxAutocomplete {

onComboboxKeyDown(event) {
var flag = false,
char = event.key,
altKey = event.altKey;

if (event.ctrlKey || event.shiftKey) {
Expand Down Expand Up @@ -492,30 +491,30 @@ class ComboboxAutocomplete {
}
}

onComboboxClick(event) {
onComboboxClick() {
if (this.isOpen()) {
this.close(true);
} else {
this.open();
}
}

onComboboxFocus(event) {
onComboboxFocus() {
this.filter = this.comboboxNode.value;
this.filterOptions();
this.setVisualFocusCombobox();
this.option = null;
this.setCurrentOptionStyle(null);
}

onComboboxBlur(event) {
onComboboxBlur() {
this.comboboxHasVisualFocus = false;
this.setCurrentOptionStyle(null);
this.removeVisualFocusAll();
setTimeout(this.close.bind(this, false), 300);
}

onButtonClick(event) {
onButtonClick() {
if (this.isOpen()) {
this.close(true);
} else {
Expand All @@ -527,11 +526,11 @@ class ComboboxAutocomplete {

/* Listbox Events */

onListboxMouseover(event) {
onListboxMouseover() {
this.hasHover = true;
}

onListboxMouseout(event) {
onListboxMouseout() {
this.hasHover = false;
setTimeout(this.close.bind(this, false), 300);
}
Expand All @@ -543,12 +542,12 @@ class ComboboxAutocomplete {
this.close(true);
}

onOptionMouseover(event) {
onOptionMouseover() {
this.hasHover = true;
this.open();
}

onOptionMouseout(event) {
onOptionMouseout() {
this.hasHover = false;
setTimeout(this.close.bind(this, false), 300);
}
Expand Down
4 changes: 1 addition & 3 deletions examples/combobox/js/combobox-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,7 @@ class ComboboxDatePicker {
}

onComboboxKeyDown(event) {
var flag = false,
char = event.key,
altKey = event.altKey;
var flag = false;

if (event.ctrlKey || event.shiftKey) {
return;
Expand Down
2 changes: 1 addition & 1 deletion examples/combobox/js/grid-combo-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function searchVeggies(searchString) {
* @desc Initialize the combobox examples once the page has loaded
*/
window.addEventListener('load', function () {
var ex1Combobox = new aria.GridCombobox(
new aria.GridCombobox(
document.getElementById('ex1-input'),
document.getElementById('ex1-grid'),
searchVeggies
Expand Down
2 changes: 1 addition & 1 deletion examples/combobox/js/grid-combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ aria.GridCombobox.prototype.handleInputKeyDown = function (evt) {
}
};

aria.GridCombobox.prototype.handleInputFocus = function (evt) {
aria.GridCombobox.prototype.handleInputFocus = function () {
this.updateResults();
};

Expand Down
4 changes: 3 additions & 1 deletion examples/dialog-modal/js/alertdialog.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global closeDialog, openDialog */

'use strict';

var aria = aria || {};
Expand All @@ -19,7 +21,7 @@ aria.Utils.triggerAlert = function (alertEl, content) {
alertEl.classList.remove('hidden');
alertEl.addEventListener(
'transitionend',
function (e) {
function () {
if (!this.classList.contains('active')) {
this.classList.add('hidden');
}
Expand Down
5 changes: 2 additions & 3 deletions examples/dialog-modal/js/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ aria.Utils = aria.Utils || {};
newFocusAfterClosed,
newFocusFirst
) {
var closedDialog = aria.getCurrentDialog();
aria.OpenDialogList.pop();
this.removeListeners();
aria.Utils.remove(this.preNode);
Expand All @@ -285,7 +284,7 @@ aria.Utils = aria.Utils || {};
this.backdropNode.classList.remove('active');

var focusAfterClosed = newFocusAfterClosed || this.focusAfterClosed;
var dialog = new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
}; // end replace

aria.Dialog.prototype.addListeners = function () {
Expand Down Expand Up @@ -313,7 +312,7 @@ aria.Utils = aria.Utils || {};
}; // end trapFocus

window.openDialog = function (dialogId, focusAfterClosed, focusFirst) {
var dialog = new aria.Dialog(dialogId, focusAfterClosed, focusFirst);
new aria.Dialog(dialogId, focusAfterClosed, focusFirst);
};

window.closeDialog = function (closeButton) {
Expand Down
8 changes: 4 additions & 4 deletions examples/disclosure/js/disclosureButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,23 @@ ButtonExpand.prototype.handleKeydown = function (event) {
}
};

ButtonExpand.prototype.handleClick = function (event) {
ButtonExpand.prototype.handleClick = function () {
this.toggleExpand();
};

ButtonExpand.prototype.handleFocus = function (event) {
ButtonExpand.prototype.handleFocus = function () {
this.domNode.classList.add('focus');
};

ButtonExpand.prototype.handleBlur = function (event) {
ButtonExpand.prototype.handleBlur = function () {
this.domNode.classList.remove('focus');
};

/* Initialize Hide/Show Buttons */

window.addEventListener(
'load',
function (event) {
function () {
var buttons = document.querySelectorAll(
'button[aria-expanded][aria-controls]'
);
Expand Down
Loading