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

@ -254,7 +254,7 @@ const roles = {
exports.roleList = roles
const canExecuteRole = (role) => {
if (!roles.hasOwnProperty(role)) return false
if (!Object.prototype.hasOwnProperty.call(roles, role)) return false
if (!isMac) return true
// macOS handles all roles natively except for a few
@ -262,20 +262,20 @@ const canExecuteRole = (role) => {
}
exports.getDefaultLabel = (role) => {
return roles.hasOwnProperty(role) ? roles[role].label : ''
return Object.prototype.hasOwnProperty.call(roles, role) ? roles[role].label : ''
}
exports.getDefaultAccelerator = (role) => {
if (roles.hasOwnProperty(role)) return roles[role].accelerator
if (Object.prototype.hasOwnProperty.call(roles, role)) return roles[role].accelerator
}
exports.shouldRegisterAccelerator = (role) => {
const hasRoleRegister = roles.hasOwnProperty(role) && roles[role].registerAccelerator !== undefined
const hasRoleRegister = Object.prototype.hasOwnProperty.call(roles, role) && roles[role].registerAccelerator !== undefined
return hasRoleRegister ? roles[role].registerAccelerator : true
}
exports.getDefaultSubmenu = (role) => {
if (!roles.hasOwnProperty(role)) return
if (!Object.prototype.hasOwnProperty.call(roles, role)) return
let { submenu } = roles[role]