diff --git a/lib/browser/api/dialog.js b/lib/browser/api/dialog.js index a41d1fa46e0c..49425c44968a 100644 --- a/lib/browser/api/dialog.js +++ b/lib/browser/api/dialog.js @@ -1,7 +1,6 @@ 'use strict' -const app = require('electron').app -const BrowserWindow = require('electron').BrowserWindow +const {app, BrowserWindow} = require('electron') const binding = process.atomBinding('dialog') const v8Util = process.atomBinding('v8_util') diff --git a/lib/browser/api/navigation-controller.js b/lib/browser/api/navigation-controller.js index c7aa7f4e92aa..1260cfb3dac7 100644 --- a/lib/browser/api/navigation-controller.js +++ b/lib/browser/api/navigation-controller.js @@ -1,6 +1,6 @@ 'use strict' -const ipcMain = require('electron').ipcMain +const {ipcMain} = require('electron') // The history operation in renderer is redirected to browser. ipcMain.on('ELECTRON_NAVIGATION_CONTROLLER', function (event, method, ...args) { diff --git a/lib/browser/api/power-monitor.js b/lib/browser/api/power-monitor.js index 02afeb5ba111..87c0069da3b6 100644 --- a/lib/browser/api/power-monitor.js +++ b/lib/browser/api/power-monitor.js @@ -1,5 +1,5 @@ -const EventEmitter = require('events').EventEmitter -const powerMonitor = process.atomBinding('power_monitor').powerMonitor +const {EventEmitter} = require('events') +const {powerMonitor} = process.atomBinding('power_monitor') Object.setPrototypeOf(powerMonitor, EventEmitter.prototype) diff --git a/lib/browser/api/screen.js b/lib/browser/api/screen.js index 9326ace2c4f1..25e3c37d3d54 100644 --- a/lib/browser/api/screen.js +++ b/lib/browser/api/screen.js @@ -1,5 +1,5 @@ -const EventEmitter = require('events').EventEmitter -const screen = process.atomBinding('screen').screen +const {EventEmitter} = require('events') +const {screen} = process.atomBinding('screen') Object.setPrototypeOf(screen, EventEmitter.prototype) diff --git a/lib/browser/api/tray.js b/lib/browser/api/tray.js index 729e430ee3fd..2afdb3643146 100644 --- a/lib/browser/api/tray.js +++ b/lib/browser/api/tray.js @@ -1,5 +1,5 @@ -const EventEmitter = require('events').EventEmitter -const Tray = process.atomBinding('tray').Tray +const {EventEmitter} = require('events') +const {Tray} = process.atomBinding('tray') Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype) diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index c706954b64bd..a1d00e7cd9cf 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -1,9 +1,7 @@ 'use strict' -const EventEmitter = require('events').EventEmitter -const ipcMain = require('electron').ipcMain -const NavigationController = require('electron').NavigationController -const Menu = require('electron').Menu +const {EventEmitter} = require('events') +const {ipcMain, Menu, NavigationController} = require('electron') const binding = process.atomBinding('web_contents') const debuggerBinding = process.atomBinding('debugger')