Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/electron/electron.git
π§ Disable standard/no-callback-literal where necessary
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
f81bfb7b86
ΠΠΎΠΌΠΌΠΈΡ
f7d6e3fa7b
|
@ -28,6 +28,8 @@ var spawnUpdate = function (args, detached, callback) {
|
|||
// Process spawned, different args: Return with error
|
||||
// No process spawned: Spawn new process
|
||||
if (spawnedProcess && !isSameArgs(args)) {
|
||||
// Disabled for backwards compatibility:
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
return callback(`AutoUpdater process with arguments ${args} is already running`)
|
||||
} else if (!spawnedProcess) {
|
||||
spawnedProcess = spawn(updateExe, args, {
|
||||
|
@ -68,6 +70,8 @@ var spawnUpdate = function (args, detached, callback) {
|
|||
|
||||
// Process terminated with error.
|
||||
if (code !== 0) {
|
||||
// Disabled for backwards compatibility:
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
return callback(`Command failed: ${signal != null ? signal : code}\n${stderr}`)
|
||||
}
|
||||
|
||||
|
@ -93,6 +97,8 @@ exports.checkForUpdate = function (updateURL, callback) {
|
|||
json = stdout.trim().split('\n').pop()
|
||||
update = (ref = JSON.parse(json)) != null ? (ref1 = ref.releasesToApply) != null ? typeof ref1.pop === 'function' ? ref1.pop() : void 0 : void 0 : void 0
|
||||
} catch (jsonError) {
|
||||
// Disabled for backwards compatibility:
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
return callback(`Invalid result:\n${stdout}`)
|
||||
}
|
||||
return callback(null, update)
|
||||
|
|
|
@ -26,6 +26,8 @@ Session.prototype.setCertificateVerifyProc = function (verifyProc) {
|
|||
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
|
||||
this._setCertificateVerifyProc(({hostname, certificate, verificationResult}, cb) => {
|
||||
verifyProc(hostname, certificate, (result) => {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
cb(result ? 0 : -2)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -311,6 +311,8 @@ const chromeExtensionHandler = function (request, callback) {
|
|||
|
||||
const page = backgroundPages[parsed.hostname]
|
||||
if (page && parsed.path === `/${page.name}`) {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
return callback({
|
||||
mimeType: 'text/html',
|
||||
data: page.html
|
||||
|
@ -319,6 +321,8 @@ const chromeExtensionHandler = function (request, callback) {
|
|||
|
||||
fs.readFile(path.join(manifest.srcDirectory, parsed.path), function (err, content) {
|
||||
if (err) {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
return callback(-6) // FILE_NOT_FOUND
|
||||
} else {
|
||||
return callback(content)
|
||||
|
|
|
@ -367,6 +367,8 @@
|
|||
return invalidArchiveError(asarPath, callback)
|
||||
}
|
||||
process.nextTick(function () {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback(archive.stat(filePath) !== false)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -147,6 +147,8 @@ exports.injectTo = function (extensionId, isBackgroundPage, context) {
|
|||
executeScript (tabId, details, callback) {
|
||||
const requestId = ++nextId
|
||||
ipcRenderer.once(`CHROME_TABS_EXECUTESCRIPT_RESULT_${requestId}`, (event, result) => {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback([event.result])
|
||||
})
|
||||
ipcRenderer.send('CHROME_TABS_EXECUTESCRIPT', requestId, tabId, extensionId, details)
|
||||
|
|
|
@ -51,6 +51,8 @@ const getStorage = (storageType, extensionId, cb) => {
|
|||
if (data !== null) {
|
||||
cb(JSON.parse(data))
|
||||
} else {
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
cb({})
|
||||
}
|
||||
})
|
||||
|
@ -82,6 +84,9 @@ const getStorageManager = (storageType, extensionId) => {
|
|||
}
|
||||
break
|
||||
}
|
||||
|
||||
// Disabled due to false positive in StandardJS
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
if (keys.length === 0) return callback({})
|
||||
|
||||
let items = {}
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅