Skip to content

Commit

Permalink
fix code style issues causing eslint to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Nov 27, 2018
1 parent 85bcecc commit 941b812
Show file tree
Hide file tree
Showing 10 changed files with 6,755 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -1,2 +1,4 @@
node_modules
target
artifacts.json
index.node
45 changes: 23 additions & 22 deletions electron-app/main.js
@@ -1,58 +1,59 @@
const electron = require('electron')
const electron = require('electron');
const path = require('path');
const url = require('url');

// Module to control application life.
const {app} = electron
const { app } = electron;
// Module to create native browser window.
const {BrowserWindow} = electron;

const path = require('path')
const url = require('url')
const { BrowserWindow } = electron;

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
let mainWindow;

function createWindow () {
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600})
mainWindow = new BrowserWindow({ width: 800, height: 600 });

// and load the index.html of the app.
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
mainWindow.loadURL(
url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
})
);

// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
mainWindow = null;
});
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
app.on('ready', createWindow);

// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
app.quit();
}
})
});

app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
createWindow();
}
})
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

5 changes: 5 additions & 0 deletions electron-app/package.json
Expand Up @@ -15,5 +15,10 @@
"dependencies": {
"electron": "3.0.8",
"neon-hello": "^0.1.1"
},
"eslintConfig": {
"rules": {
"import/no-unresolved": "off"
}
}
}
4 changes: 2 additions & 2 deletions fibonacci-task/lib/index.js
@@ -1,8 +1,8 @@
const addon = require('../native/index.node');

addon.fibonacci(100000, (err, result) => {
console.log('async result:');
console.log(result);
console.log('async result:');
console.log(result);
});

console.log('computing fibonacci(1000000) in background thread...');
Expand Down
1 change: 0 additions & 1 deletion hello-world/native/src/lib.rs
@@ -1,6 +1,5 @@
#[macro_use]
extern crate neon;
extern crate num_cpus;

use neon::prelude::*;

Expand Down

0 comments on commit 941b812

Please sign in to comment.