mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-28 09:23:42 +03:00
lint: fixes (#85)
This commit is contained in:
parent
0db3101013
commit
66d3dd8626
@ -34,7 +34,6 @@ module.exports = {
|
|||||||
"markers": ["*"]
|
"markers": ["*"]
|
||||||
}],
|
}],
|
||||||
"eqeqeq": [2],
|
"eqeqeq": [2],
|
||||||
"arrow-body-style": [2, "as-needed"],
|
|
||||||
"accessor-pairs": [2, {
|
"accessor-pairs": [2, {
|
||||||
"getWithoutSet": false,
|
"getWithoutSet": false,
|
||||||
"setWithoutGet": false
|
"setWithoutGet": false
|
||||||
@ -76,7 +75,11 @@ module.exports = {
|
|||||||
// spacing details
|
// spacing details
|
||||||
"space-infix-ops": 2,
|
"space-infix-ops": 2,
|
||||||
"space-in-parens": [2, "never"],
|
"space-in-parens": [2, "never"],
|
||||||
"space-before-function-paren": [2, "never"],
|
"space-before-function-paren": [2, {
|
||||||
|
"anonymous": "never",
|
||||||
|
"named": "never",
|
||||||
|
"asyncArrow": "always"
|
||||||
|
}],
|
||||||
"no-whitespace-before-property": 2,
|
"no-whitespace-before-property": 2,
|
||||||
"keyword-spacing": [2, {
|
"keyword-spacing": [2, {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
@ -153,7 +153,7 @@ export class ElementHandle extends JSHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _scrollIntoViewIfNeeded() {
|
async _scrollIntoViewIfNeeded() {
|
||||||
const error = await this.evaluate(async(element, pageJavascriptEnabled) => {
|
const error = await this.evaluate(async (element, pageJavascriptEnabled) => {
|
||||||
if (!element.isConnected)
|
if (!element.isConnected)
|
||||||
return 'Node is detached from document';
|
return 'Node is detached from document';
|
||||||
if (element.nodeType !== Node.ELEMENT_NODE)
|
if (element.nodeType !== Node.ELEMENT_NODE)
|
||||||
|
@ -326,7 +326,7 @@ export class ElementHandle extends JSHandle {
|
|||||||
}
|
}
|
||||||
await this.evaluate(async (element: HTMLInputElement, payloads: FilePayload[]) => {
|
await this.evaluate(async (element: HTMLInputElement, payloads: FilePayload[]) => {
|
||||||
const files = await Promise.all(payloads.map(async (file: FilePayload) => {
|
const files = await Promise.all(payloads.map(async (file: FilePayload) => {
|
||||||
const result = await fetch(`data:${file.mimeType};base64,${file.data}`)
|
const result = await fetch(`data:${file.mimeType};base64,${file.data}`);
|
||||||
return new File([await result.blob()], file.name);
|
return new File([await result.blob()], file.name);
|
||||||
}));
|
}));
|
||||||
const dt = new DataTransfer();
|
const dt = new DataTransfer();
|
||||||
|
@ -45,7 +45,7 @@ class Helper {
|
|||||||
const method = Reflect.get(classType.prototype, methodName);
|
const method = Reflect.get(classType.prototype, methodName);
|
||||||
if (methodName === 'constructor' || typeof methodName !== 'string' || methodName.startsWith('_') || typeof method !== 'function' || method.constructor.name !== 'AsyncFunction')
|
if (methodName === 'constructor' || typeof methodName !== 'string' || methodName.startsWith('_') || typeof method !== 'function' || method.constructor.name !== 'AsyncFunction')
|
||||||
continue;
|
continue;
|
||||||
Reflect.set(classType.prototype, methodName, function(...args) {
|
Reflect.set(classType.prototype, methodName, function(...args: any[]) {
|
||||||
const syncStack: any = {};
|
const syncStack: any = {};
|
||||||
Error.captureStackTrace(syncStack);
|
Error.captureStackTrace(syncStack);
|
||||||
return method.call(this, ...args).catch(e => {
|
return method.call(this, ...args).catch(e => {
|
||||||
|
@ -142,7 +142,7 @@ export class ElementHandle extends JSHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _scrollIntoViewIfNeeded() {
|
async _scrollIntoViewIfNeeded() {
|
||||||
const error = await this.evaluate(async(element, pageJavascriptEnabled) => {
|
const error = await this.evaluate(async (element, pageJavascriptEnabled) => {
|
||||||
if (!element.isConnected)
|
if (!element.isConnected)
|
||||||
return 'Node is detached from document';
|
return 'Node is detached from document';
|
||||||
if (element.nodeType !== Node.ELEMENT_NODE)
|
if (element.nodeType !== Node.ELEMENT_NODE)
|
||||||
|
Loading…
Reference in New Issue
Block a user