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

chore: fix eslint no-undef #1462

Merged
merged 3 commits into from
Jan 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module.exports = {
// start with google standard style
// https://github.com/google/eslint-config-google/blob/master/index.js
"extends": "google",
"extends": ["eslint:recommended", "google"],
"env": {
"node": true
"node": true,
"es6": true
},
"rules": {
// 2 == error, 1 == warning, 0 == off
Expand All @@ -16,6 +17,9 @@ module.exports = {
"ignoreUrls": true,
"tabWidth": 2
}],
"no-empty": [2, {
"allowEmptyCatch": true
}],
"no-implicit-coercion": [2, {
"boolean": false,
"number": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

/* global window, document, location */
/* global window, document, location, fetch */

'use strict';

Expand Down
2 changes: 2 additions & 0 deletions lighthouse-cli/test/fixtures/static-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
'use strict';

/* eslint-disable no-console */

const http = require('http');
const path = require('path');
const fs = require('fs');
Expand Down
2 changes: 2 additions & 0 deletions lighthouse-cli/test/smokehouse/smokehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
'use strict';

/* eslint-disable no-console */

const path = require('path');
const spawnSync = require('child_process').spawnSync;
const yargs = require('yargs');
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ class Driver {
* @return {function(...*): *} A wrapper around the original function.
*/
function captureJSCallUsage(funcRef, set) {
/* global window */
const __nativeError = window.__nativeError || Error;
const originalFunc = funcRef;
const originalPrepareStackTrace = __nativeError.prepareStackTrace;
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

const environment = require('../lighthouse-core/lib/environment');
if (!environment.checkNodeCompatibility()) {
// eslint-disable-next-line no-console
console.warn('Compatibility error', 'Lighthouse requires node 5+ or 4 with --harmony');
process.exit(1);
}
Expand Down
2 changes: 2 additions & 0 deletions lighthouse-core/lib/console-quieter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

'use strict';

/* eslint-disable no-console */

const log = require('./log.js');

class ConsoleQuieter {
Expand Down
2 changes: 2 additions & 0 deletions lighthouse-core/scripts/build-traceviewer-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
'use strict';

/* eslint-disable no-console */

const fs = require('fs');
const path = require('path');
const jsdom = require('jsdom');
Expand Down
2 changes: 2 additions & 0 deletions lighthouse-extension/app/src/chromereload.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

'use strict';

/* eslint-disable no-console */

// Reload client for Chrome Apps & Extensions.
// The reload client has a compatibility with livereload.
// WARNING: only supports reload command.
Expand Down
1 change: 1 addition & 0 deletions lighthouse-extension/app/src/lighthouse-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ window.isRunning = function() {
if (window.chrome && chrome.runtime) {
chrome.runtime.onInstalled.addListener(details => {
if (details.previousVersion) {
// eslint-disable-next-line no-console
console.log('previousVersion', details.previousVersion);
}
});
Expand Down
6 changes: 4 additions & 2 deletions lighthouse-viewer/app/src/lighthouse-report-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,12 @@ class LighthouseViewerReport {
case 'print':
window.print();
break;
case 'save-json':
case 'save-json': {
const jsonStr = JSON.stringify(this.json, null, 2);
this._saveFile(new Blob([jsonStr], {type: 'application/json'}));
break;
case 'save-html':
}
case 'save-html': {
const reportGenerator = new ReportGenerator();
try {
const htmlStr = reportGenerator.generateHTML(this.json, 'cli');
Expand All @@ -383,6 +384,7 @@ class LighthouseViewerReport {
logger.error('Could not export as HTML.');
}
break;
}
}

this.closeExportDropdown();
Expand Down
2 changes: 2 additions & 0 deletions lighthouse-viewer/app/src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

'use strict';

/* eslint-disable no-console */

/**
* Logs messages via a UI butter.
* @class
Expand Down