Use window.log in browser context, turn on console eslint rule

This commit is contained in:
Scott Nonnenberg 2018-07-21 12:00:08 -07:00
parent 4320b125dd
commit 5933a34a18
71 changed files with 816 additions and 559 deletions

6
app/.eslintrc.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = {
rules: {
// On the node.js side, we're still using console.log
'no-console': 'off',
},
};

16
app/global_errors.js Normal file
View file

@ -0,0 +1,16 @@
const addUnhandledErrorHandler = require('electron-unhandled');
const Errors = require('../js/modules/types/errors');
// addHandler :: Unit -> Unit
exports.addHandler = () => {
addUnhandledErrorHandler({
logger: error => {
console.error(
'Uncaught error or unhandled promise rejection:',
Errors.toLogFormat(error)
);
},
showDialog: false,
});
};