chore(eslint): add rule no-unused-expressions (#4848)

This commit is contained in:
Joel Einbinder 2020-12-29 09:59:35 -08:00 committed by GitHub
parent d08f8487c4
commit 6697dadca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View file

@ -65,6 +65,7 @@ module.exports = {
"radix": 2,
"valid-typeof": 2,
"no-implicit-globals": [2],
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true}],
// es2015 features
"require-yield": 2,

View file

@ -78,7 +78,6 @@ class FFAXNode implements accessibility.AXNode {
this._expanded = !!payload.expanded;
this._name = this._payload.name;
this._role = this._payload.role;
this._cachedHasFocusableChild;
}
_isPlainTextField(): boolean {

View file

@ -35,9 +35,9 @@ export class PipeTransport implements ConnectionTransport {
this._closed = true;
if (this.onclose)
this.onclose.call(null);
}),
pipeRead.on('error', e => debugLogger.log('error', e)),
pipeWrite.on('error', e => debugLogger.log('error', e)),
});
pipeRead.on('error', e => debugLogger.log('error', e));
pipeWrite.on('error', e => debugLogger.log('error', e));
this.onmessage = undefined;
this.onclose = undefined;
}

View file

@ -188,7 +188,7 @@ class HarContextTracer {
const harEntry = this._entries.get(response.request())!;
// Rewrite provisional headers with actual
const request = response.request();
harEntry.request.headers = request.headers().map(header => ({ name: header.name, value: header.value })),
harEntry.request.headers = request.headers().map(header => ({ name: header.name, value: header.value }));
harEntry.request.cookies = cookiesForHar(request.headerValue('cookie'), ';');
harEntry.request.postData = postDataForHar(request) || undefined;

View file

@ -111,7 +111,7 @@ describe('cli codegen', (test, { browserName, headful }) => {
expect(selector).toBe('input[name="name"]');
const messages: any[] = [];
page.on('console', message => messages.push(message)),
page.on('console', message => messages.push(message));
await Promise.all([
recorder.waitForActionPerformed(),
recorder.waitForOutput('press'),
@ -161,7 +161,7 @@ describe('cli codegen', (test, { browserName, headful }) => {
const messages: any[] = [];
page.on('console', message => {
messages.push(message);
}),
});
await Promise.all([
recorder.waitForActionPerformed(),
recorder.waitForOutput('press'),
@ -182,7 +182,7 @@ describe('cli codegen', (test, { browserName, headful }) => {
const messages: any[] = [];
page.on('console', message => {
messages.push(message);
}),
});
await Promise.all([
recorder.waitForActionPerformed(),
recorder.waitForOutput('press'),

View file

@ -424,7 +424,7 @@ it('should not throw "Invalid Interception Id" if the request was cancelled', as
await page.setContent('<iframe></iframe>');
let route = null;
await page.route('**/*', async r => route = r);
page.$eval('iframe', (frame, url) => frame.src = url, server.EMPTY_PAGE),
page.$eval('iframe', (frame, url) => frame.src = url, server.EMPTY_PAGE);
// Wait for request interception.
await page.waitForEvent('request');
// Delete frame to cause request to be canceled.