build: update eslint + eslint plugins (#22777)

* build: run eslint --fix

* chore: manually fix all hasOwnProperty errors

* chore: manually fix all void 0 vs undefined errors

* chore: manually fix all async-in-promise errors

* chore: manually fix lexical declaration in case block
This commit is contained in:
Samuel Attard 2020-03-20 08:12:18 -07:00 committed by GitHub
parent 42f138282f
commit b87b501161
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 280 additions and 280 deletions

View file

@ -109,7 +109,7 @@ function setObjectMembers (ref, object, metaId, members) {
if (!Array.isArray(members)) return
for (const member of members) {
if (object.hasOwnProperty(member.name)) continue
if (Object.prototype.hasOwnProperty.call(object, member.name)) continue
const descriptor = { enumerable: member.enumerable }
if (member.type === 'method') {
@ -188,7 +188,7 @@ function proxyFunctionProperties (remoteMemberFunction, metaId, name) {
return true
},
get: (target, property, receiver) => {
if (!target.hasOwnProperty(property)) loadRemoteProperties()
if (!Object.prototype.hasOwnProperty.call(target, property)) loadRemoteProperties()
const value = target[property]
if (property === 'toString' && typeof value === 'function') {
return value.bind(target)

View file

@ -45,7 +45,7 @@ const replacePlaceholders = (message: string, placeholders: Record<string, Place
const getMessage = (extensionId: number, messageName: string, substitutions: string[]) => {
const messages = getMessages(extensionId)
if (messages.hasOwnProperty(messageName)) {
if (Object.prototype.hasOwnProperty.call(messages, messageName)) {
const { message, placeholders } = messages[messageName]
return replacePlaceholders(message, placeholders, substitutions)
}

View file

@ -14,7 +14,7 @@ export const handle = function <T extends IPCHandler> (channel: string, handler:
}
export function invokeSync<T> (command: string, ...args: any[]): T {
const [ error, result ] = ipcRendererInternal.sendSync(command, ...args)
const [error, result] = ipcRendererInternal.sendSync(command, ...args)
if (error) {
throw error

View file

@ -222,7 +222,7 @@ const warnAboutExperimentalFeatures = function (webPreferences?: Electron.WebPre
*/
const warnAboutEnableBlinkFeatures = function (webPreferences?: Electron.WebPreferences) {
if (!webPreferences ||
!webPreferences.hasOwnProperty('enableBlinkFeatures') ||
!Object.prototype.hasOwnProperty.call(webPreferences, 'enableBlinkFeatures') ||
(webPreferences.enableBlinkFeatures && webPreferences.enableBlinkFeatures.length === 0)) {
return
}

View file

@ -24,10 +24,10 @@ const WEB_VIEW_EVENTS: Record<string, Array<string>> = {
'did-frame-navigate': ['url', 'httpResponseCode', 'httpStatusText', 'isMainFrame', 'frameProcessId', 'frameRoutingId'],
'did-navigate-in-page': ['url', 'isMainFrame', 'frameProcessId', 'frameRoutingId'],
'focus-change': ['focus', 'guestInstanceId'],
'close': [],
'crashed': [],
close: [],
crashed: [],
'plugin-crashed': ['name', 'version'],
'destroyed': [],
destroyed: [],
'page-title-updated': ['title', 'explicitSet'],
'page-favicon-updated': ['favicons'],
'enter-html-full-screen': [],

View file

@ -72,7 +72,7 @@ export class WebViewImpl {
// heard back from createGuest yet. We will not reset the flag in this case so
// that we don't end up allocating a second guest.
if (this.guestInstanceId) {
this.guestInstanceId = void 0
this.guestInstanceId = undefined
}
this.beforeFirstNavigation = true
@ -173,7 +173,7 @@ export class WebViewImpl {
}
for (const attributeName in this.attributes) {
if (this.attributes.hasOwnProperty(attributeName)) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attributeName)) {
params[attributeName] = this.attributes[attributeName].getValue()
}
}

View file

@ -126,6 +126,7 @@ class BrowserWindowProxy {
public get location (): LocationProxy | any {
return this._location
}
public set location (url: string | any) {
url = resolveURL(url, this.location.href)
this._invokeWebContentsMethod('loadURL', url)