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

use ESLint:recommended #1207

Merged
merged 12 commits into from
Oct 22, 2019
112 changes: 7 additions & 105 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,109 +1,11 @@
{
"extends": "eslint:recommended",
"env": {
"browser": true
},
"rules": {
"no-with": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": 2,
"no-multi-spaces": 0,
"operator-linebreak": [
2,
"after"
],
"quote-props": 0,
"key-spacing": [
2,
{
"afterColon": true
}
],
"space-unary-ops": [
2,
{
"words": false,
"nonwords": false
}
],
"no-spaced-func": 2,
"array-bracket-spacing": [
2,
"never",
{
"singleValue": true
}
],
"space-in-parens": [
2,
"never"
],
"comma-dangle": [
2,
"never"
],
"no-trailing-spaces": 2,
"yoda": [
2,
"never"
],
"camelcase": [
2,
{
"properties": "always"
}
],
"comma-style": [
2,
"last"
],
"curly": [
2,
"all"
],
"dot-notation": 2,
"brace-style": [
2,
"stroustrup",
{
"allowSingleLine": true
}
],
"eol-last": 2,
"wrap-iife": 2,
"semi": [
2,
"always"
],
"space-infix-ops": 2,
"keyword-spacing": [
2,
{}
],
"spaced-comment": [
2,
"always"
],
"space-before-blocks": [
2,
"always"
],
"space-before-function-paren": [
2,
"always"
],
"consistent-this": [
2,
"self"
],
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"quotes": [
2,
"single"
],
"no-eval": "error",
"no-implied-eval": "error"
"no-unused-vars": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to fix this in the future? is there a follow up task for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be fixed going forward, but I didn't spin up an issue for the 3 that are turned off right now

"no-undef": 0,
"no-fallthrough": 0
}
}
4 changes: 2 additions & 2 deletions examples/combobox/aria1.0pattern/js/listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var Listbox = function (domNode, comboboxObj) {
msgPrefix = 'Listbox constructor argument domNode ';

// Check whether domNode is a DOM element
if (!domNode instanceof Element) {
if (!(domNode instanceof Element)) {
throw new TypeError(msgPrefix + 'is not a DOM Element.');
}

Expand Down Expand Up @@ -65,7 +65,7 @@ Listbox.prototype.init = function () {
optionElement = optionElements[i];

if (!optionElement.firstElementChild && optionElement.getAttribute('role') != 'separator') {
option = new Option(optionElement, this);
option = new ListboxOption(optionElement, this);
option.init();
this.allOptions.push(option);
}
Expand Down
10 changes: 5 additions & 5 deletions examples/combobox/aria1.0pattern/js/listboxOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This content is licensed according to the W3C Software License at
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*/
var Option = function (domNode, listboxObj) {
var ListboxOption = function (domNode, listboxObj) {

this.domNode = domNode;
this.listbox = listboxObj;
Expand All @@ -11,7 +11,7 @@ var Option = function (domNode, listboxObj) {

};

Option.prototype.init = function () {
ListboxOption.prototype.init = function () {

if (!this.domNode.getAttribute('role')) {
this.domNode.setAttribute('role', 'option');
Expand All @@ -25,18 +25,18 @@ Option.prototype.init = function () {

/* EVENT HANDLERS */

Option.prototype.handleClick = function (event) {
ListboxOption.prototype.handleClick = function (event) {
this.listbox.setOption(this);
this.listbox.close(true);
};

Option.prototype.handleMouseover = function (event) {
ListboxOption.prototype.handleMouseover = function (event) {
this.listbox.hasHover = true;
this.listbox.open();

};

Option.prototype.handleMouseout = function (event) {
ListboxOption.prototype.handleMouseout = function (event) {
this.listbox.hasHover = false;
setTimeout(this.listbox.close.bind(this.listbox, false), 300);
};
1 change: 1 addition & 0 deletions examples/dialog-modal/js/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ aria.Utils = aria.Utils || {};
element.focus();
}
catch (e) {
// continue regardless of error
}
aria.Utils.IgnoreUtilFocusChanges = false;
return (document.activeElement === element);
Expand Down
Loading