Skip to content

Commit f3e7ce0

Browse files
authored
Merge pull request #74 from ChromeDevTools/eslintbump
linting updates.
2 parents 91fb5cc + 124aa61 commit f3e7ce0

File tree

8 files changed

+427
-327
lines changed

8 files changed

+427
-327
lines changed

.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ module.exports = {
55
"env": {
66
"browser": true,
77
"es6": true,
8+
"cypress/globals": true,
89
},
10+
"plugins": [
11+
"cypress"
12+
],
913
"globals": {
1014
gapi: true,
1115
Bindings: true,
@@ -60,9 +64,8 @@ module.exports = {
6064
"comma-dangle": 0,
6165
"arrow-parens": 0,
6266
"no-undef": 1,
63-
"no-console": 1,
67+
"no-console": 0,
6468
"no-invalid-this": 1,
65-
"prefer-rest-params": 1,
6669
},
6770
"parserOptions": {
6871
"ecmaVersion": 2018,

docs/auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ class GoogleAuth {
3131
gapi.client.setApiKey(this.config.apiKey);
3232

3333
// if we have no authinstance yet, initialize
34-
if (!GoogleAuth.getAuthInstance())
34+
if (!GoogleAuth.getAuthInstance()) {
3535
return gapi.auth2.init(oAuthOptions).then(callback);
36+
}
3637

3738
// handle the click
3839
this.signIn().then(callback);

docs/dev_tools.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ class DevTools {
3636
set: _ => { },
3737
getAsArray: _ => []
3838
};
39-
if (module === 'releaseNoteVersionSeen')
39+
if (module === 'releaseNoteVersionSeen') {
4040
ret.get = _ => Infinity;
41-
if (module === 'showNativeFunctionsInJSProfile')
41+
}
42+
if (module === 'showNativeFunctionsInJSProfile') {
4243
ret.get = _ => true;
43-
if (module === 'flamechartMouseWheelAction')
44+
}
45+
if (module === 'flamechartMouseWheelAction') {
4446
ret.get = _ => 'zoom';
47+
}
4548
return ret;
4649
};
4750

@@ -138,7 +141,7 @@ class DevTools {
138141
.shadowRoot.querySelector('.toolbar-shadow')
139142
.querySelectorAll('button,div').
140143
forEach(elem => elem.remove());
141-
} catch(e) {
144+
} catch (e) {
142145
console.warn('failed to tweak UI', e);
143146
}
144147
}
@@ -156,9 +159,9 @@ class DevTools {
156159
const timelinePanel = Timeline.TimelinePanel.instance();
157160
const dropTarget = timelinePanel._dropTarget;
158161
const handleDrop = dropTarget._handleDrop;
159-
dropTarget._handleDrop = function(_) {
162+
dropTarget._handleDrop = function(...args) {
160163
viewerInstance.toggleUploadToDriveElem(viewerInstance.canUploadToDrive);
161-
handleDrop.apply(dropTarget, arguments);
164+
handleDrop.apply(dropTarget, ...args);
162165
};
163166
}
164167
}
@@ -167,10 +170,12 @@ class DevTools {
167170
const panel = Timeline.TimelinePanel.instance();
168171
const oldSetMarkers = panel._setMarkers;
169172
panel._setMarkers = function() {
170-
if (this._performanceModel._timelineModel.networkRequests().length === 0)
173+
if (this._performanceModel._timelineModel.networkRequests().length === 0) {
171174
Common.settings.createSetting('timelineCaptureNetwork', true).set(false);
172-
if (this._performanceModel.filmStripModel()._frames.length === 0)
175+
}
176+
if (this._performanceModel.filmStripModel()._frames.length === 0) {
173177
Common.settings.createSetting('timelineCaptureFilmStrip', true).set(false);
178+
}
174179
oldSetMarkers.call(this, this._performanceModel._timelineModel);
175180
};
176181
}

docs/sync_view.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ class SyncView {
131131
}
132132

133133
originalPanel() {
134-
if (!this._originalPanel)
134+
if (!this._originalPanel) {
135135
this._originalPanel = Timeline.TimelinePanel.instance();
136+
}
136137

137138
return this._originalPanel;
138139
}

docs/timeline_viewer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Viewer {
88
this.params = new URL(location.href).searchParams;
99
this.syncView = new SyncView();
1010
this.timelineURL = this.params.get('loadTimelineFromURL');
11-
this.timelineId;
11+
this.timelineId = null;
1212
this.timelineProvider = 'url';
1313

1414
this.totalSize = 50 * 1000 * 1000;
@@ -105,8 +105,9 @@ class Viewer {
105105

106106
handleDragEvents() {
107107
const dropboxEl = document.getElementById('dropbox');
108-
if (dropboxEl)
108+
if (dropboxEl) {
109109
dropboxEl.addEventListener('dragover', this.dragover.bind(this), false);
110+
}
110111
}
111112

112113
toggleUploadToDriveElem(display) {
@@ -270,8 +271,9 @@ class Viewer {
270271
return this._orig_loadResourcePromise(redirectedURL.toString());
271272
}
272273

273-
if (this.timelineProvider === 'drive')
274+
if (this.timelineProvider === 'drive') {
274275
return this.driveAssetLoaded.then(payload => payload);
276+
}
275277

276278
// pass through URLs that aren't our timelineURL param
277279
if (requestedURL !== this.timelineURL) {

docs/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class Utils {
2929
resolve(xhr);
3030
};
3131
xhr.onerror = error => {
32-
reject({error, xhr});
32+
console.error('XHR error', error);
33+
reject(error);
3334
};
3435
xhr.send(body);
3536
});

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"license": "Apache-2.0",
2121
"devDependencies": {
2222
"cypress": "^4.0.2",
23-
"eslint": "^4.19.1",
24-
"eslint-config-google": "^0.7.1",
23+
"eslint": "^6.8.0",
24+
"eslint-config-google": "^0.14.0",
25+
"eslint-plugin-cypress": "^2.10.3",
2526
"http-server": "^0.12.1",
2627
"opn-cli": "^5.0.0",
2728
"pre-push": "^0.1.1",

0 commit comments

Comments
 (0)