Skip to content

Commit

Permalink
Infrastructure: Enable ESLint no-console (pull #1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored Dec 14, 2020
1 parent b874a47 commit 601cebd
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"ecmaVersion": 6
},
"rules": {
"strict": [2, "global"]
"strict": [2, "global"],
"no-console": "error"
},
"overrides": [
{
Expand Down
2 changes: 0 additions & 2 deletions examples/checkbox/checkbox-2/js/controlledCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ var ControlledCheckbox = function (domNode, controllerObj) {
ControlledCheckbox.prototype.init = function () {
this.lastState = this.isChecked();

console.log(this.lastState);

this.domNode.addEventListener('change', this.handleChange.bind(this));

this.domNode.addEventListener('keydown', this.handleKeyup.bind(this), true);
Expand Down
2 changes: 0 additions & 2 deletions examples/disclosure/js/disclosureButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ ButtonExpand.prototype.toggleExpand = function () {
/* EVENT HANDLERS */

ButtonExpand.prototype.handleKeydown = function (event) {
console.log('[keydown]');

switch (event.keyCode) {
case this.keyCode.RETURN:
this.toggleExpand();
Expand Down
3 changes: 3 additions & 0 deletions examples/js/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,15 @@ function addOpenInCodePenForm(
}
totalFetchedFiles++;
} else {
// eslint-disable-next-line no-console
console.warn(
"Not showing 'Open in Codepen' button. Could not load resource: " +
href
);
}
};
request.onerror = function () {
// eslint-disable-next-line no-console
console.warn(
"Not showing 'Open in Codepen' button. Could not load resource: " +
fileLink.href
Expand All @@ -461,6 +463,7 @@ function addOpenInCodePenForm(

setTimeout(() => {
clearInterval(timerId);
// eslint-disable-next-line no-console
console.warn(
"Not showing 'Open in Codepen' button. Timeout when loading resource."
);
Expand Down
1 change: 0 additions & 1 deletion examples/slider/js/vertical-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ VSlider.prototype.moveVSliderTo = function (value) {
if (this.valueDomNode) {
this.valueDomNode.innerHTML = this.valueNow.toString();
this.valueDomNode.style.left = this.railDomNode.offsetWidth / 2 - 2 + 'px';
console.log(this.valueDomNode.style.left);
}
};

Expand Down
1 change: 0 additions & 1 deletion test/tests/combobox_autocomplete-both.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ ariaTest(
);
const id = await combobox.getAttribute('id');

console.log(id);
t.truthy(id, '"id" attribute should exist on combobox');

const label = await t.context.queryElements(t, `[for="${id}"]`);
Expand Down
1 change: 0 additions & 1 deletion test/tests/combobox_autocomplete-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ ariaTest(
);
const id = await combobox.getAttribute('id');

console.log(id);
t.truthy(id, '"id" attribute should exist on combobox');

const label = await t.context.queryElements(t, `[for="${id}"]`);
Expand Down
1 change: 0 additions & 1 deletion test/tests/combobox_autocomplete-none.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ ariaTest(
);
const id = await combobox.getAttribute('id');

console.log(id);
t.truthy(id, '"id" attribute should exist on combobox');

const label = await t.context.queryElements(t, `[for="${id}"]`);
Expand Down
1 change: 1 addition & 0 deletions test/util/report.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable no-console */

const cheerio = require('cheerio');
const path = require('path');
Expand Down

0 comments on commit 601cebd

Please sign in to comment.