fix eslint config (#1462)
* update to bring in `eslint:recommended` as base config
This commit is contained in:
Родитель
ce7927307d
Коммит
96173a2302
|
@ -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
|
||||
|
@ -16,6 +17,9 @@ module.exports = {
|
|||
"ignoreUrls": true,
|
||||
"tabWidth": 2
|
||||
}],
|
||||
"no-empty": [2, {
|
||||
"allowEmptyCatch": true
|
||||
}],
|
||||
"no-implicit-coercion": [2, {
|
||||
"boolean": false,
|
||||
"number": true,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* global window, document, location */
|
||||
/* global window, document, location, fetch */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const http = require('http');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const path = require('path');
|
||||
const spawnSync = require('child_process').spawnSync;
|
||||
const yargs = require('yargs');
|
||||
|
|
|
@ -739,6 +739,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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const log = require('./log.js');
|
||||
|
||||
class ConsoleQuieter {
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
*/
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const jsdom = require('jsdom');
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
|
@ -383,6 +384,7 @@ class LighthouseViewerReport {
|
|||
logger.error('Could not export as HTML.');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.closeExportDropdown();
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
/**
|
||||
* Logs messages via a UI butter.
|
||||
* @class
|
||||
|
|
Загрузка…
Ссылка в новой задаче