Skip to content

Commit 19013fe

Browse files
committed
Merge pull request electron#118 from electron/lint
Lint using standard
2 parents 45208c7 + 9012ca0 commit 19013fe

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ electron.hideInternalModules()
99
process.throwDeprecation = true
1010

1111
// Require and setup each JS file in the main-process dir
12-
glob(__dirname + '/main-process/**/*.js', function (error, files) {
12+
glob(path.join(__dirname, 'main-process/**/*.js'), function (error, files) {
1313
if (error) return console.log(error)
1414
files.forEach(function (file) {
1515
require(file)
@@ -19,7 +19,7 @@ glob(__dirname + '/main-process/**/*.js', function (error, files) {
1919
function createWindow () {
2020
var iconPath = path.join(__dirname, '/assets/app-icon/png/512.png')
2121
mainWindow = new BrowserWindow({ width: 1080, minWidth: 680, height: 800, icon: iconPath })
22-
mainWindow.loadURL('file://' + __dirname + '/index.html')
22+
mainWindow.loadURL('file://' + path.join(__dirname, 'index.html'))
2323
mainWindow.on('closed', function () {
2424
mainWindow = null
2525
})

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "main.js",
77
"scripts": {
88
"start": "electron .",
9-
"lint": "standard-format --write",
9+
"lint": "standard",
1010
"test": "mocha tests && npm run lint",
1111
"sign-win": "signcode -spc ~/electron-api-demos.spc -v ~/electron-api-demos.pvk -a sha1 -$ commercial -n 'Electron API Demos' -i http://electron.atom.io -t http://timestamp.verisign.com/scripts/timstamp.dll -tr 10 './out/Electron API Demos-win32-ia32/Electron API Demos.exe'",
1212
"pack-mac": "electron-packager . 'Electron API Demos' --overwrite --platform=darwin --arch=x64 --icon=assets/app-icon/mac/app.icns --prune=true --out=out --sign='Developer ID Application: GitHub'",
@@ -43,7 +43,7 @@
4343
"mocha": "^2.3.4",
4444
"request": "^2.70.0",
4545
"spectron": "~1.37.0",
46-
"standard-format": "^2.1.1"
46+
"standard": "^6.0.8"
4747
},
4848
"dependencies": {
4949
"electron-json-storage": "^2.0.0",

renderer-process/communication/invisible-msg.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
var BrowserWindow = require('electron').remote.BrowserWindow
22
var ipcRenderer = require('electron').ipcRenderer
3+
var path = require('path')
34

45
var invisMsgBtn = document.getElementById('invis-msg')
56
var invisReply = document.getElementById('invis-reply')
67

78
invisMsgBtn.addEventListener('click', function (clickEvent) {
89
var windowID = BrowserWindow.getFocusedWindow().id
9-
var invisPath = 'file://' + __dirname + '/sections/communication/invisible.html'
10+
var invisPath = 'file://' + path.join(__dirname, 'sections/communication/invisible.html')
1011
var win = new BrowserWindow({ width: 400, height: 400, show: false })
1112
win.loadURL(invisPath)
1213

renderer-process/windows/create-window.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
var BrowserWindow = require('electron').remote.BrowserWindow
2+
var path = require('path')
3+
24
var newWindowBtn = document.getElementById('new-window')
35

46
newWindowBtn.addEventListener('click', function (event) {
5-
var modalPath = 'file://' + __dirname + '/sections/windows/modal.html'
7+
var modalPath = 'file://' + path.join(__dirname, 'sections/windows/modal.html')
68
var win = new BrowserWindow({ width: 400, height: 320 })
79
win.on('closed', function () { win = null })
810
win.loadURL(modalPath)

renderer-process/windows/manage-window.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
var BrowserWindow = require('electron').remote.BrowserWindow
2+
var path = require('path')
3+
24
var manageWindowBtn = document.getElementById('manage-window')
35

46
manageWindowBtn.addEventListener('click', function (event) {
5-
var modalPath = 'file://' + __dirname + '/sections/windows/manage-modal.html'
7+
var modalPath = 'file://' + path.join(__dirname, 'sections/windows/manage-modal.html')
68
var win = new BrowserWindow({ width: 400, height: 225 })
79

810
win.on('resize', updateReply)

script/release renamed to script/release.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ function zipAssets () {
5454
const assets = [{
5555
name: 'electron-api-demos-mac.zip',
5656
path: path.join(__dirname, '..', 'out', 'Electron API Demos-darwin-x64', 'Electron API Demos.app')
57-
},
58-
{
57+
}, {
5958
name: 'electron-api-demos-windows.zip',
6059
path: path.join(__dirname, '..', 'out', 'Electron API Demos-win32-ia32')
61-
},
62-
{
60+
}, {
6361
name: 'electron-api-demos-linux.zip',
6462
path: path.join(__dirname, '..', 'out', 'Electron API Demos-linux-x64')
6563
}]

0 commit comments

Comments
 (0)