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: Enable ESLint no-console #1646

Merged
merged 2 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 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 @@ -431,13 +431,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 @@ -457,6 +459,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