Setup ESLint and Prettier and apply changes to sources #891

Merged
IGassmann merged 22 commits from issue/763 into master 2017-12-27 21:22:51 +01:00
Showing only changes of commit a9d386e5dd - Show all commits

View file

@ -1,6 +1,7 @@
const path = require('path');
const Path = require("path");
const FlowFlowPlugin = require("./flowtype-plugin");
const ELECTRON_RENDERER_PROCESS_ROOT = path.resolve(__dirname, 'src/renderer/');
const ELECTRON_RENDERER_PROCESS_ROOT = Path.resolve(__dirname, "src/renderer/");
module.exports = {
// This rule is temporarily necessary until https://github.com/electron-userland/electron-webpack/issues/60 is fixed.
@ -8,26 +9,27 @@ module.exports = {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
loader: "babel-loader",
options: {
presets: ['env', 'react', 'stage-2']
}
}
]
presets: ["env", "react", "stage-2"],
},
},
],
},
// This allows imports to be made from the renderer process root (https://moduscreate.com/blog/es6-es2015-import-no-relative-path-webpack/).
resolve: {
modules: [ELECTRON_RENDERER_PROCESS_ROOT, 'node_modules', __dirname],
extensions: ['.js', '.jsx', '.scss']
}
modules: [ELECTRON_RENDERER_PROCESS_ROOT, "node_modules", __dirname],
extensions: [".js", ".jsx", ".scss"],
},
};
if (process.env.NODE_ENV === 'development') {
const FLOW_BABEL_WEBPACK_PLUGIN = require('./flowtype-plugin');
module.exports.plugins = [
new FLOW_BABEL_WEBPACK_PLUGIN({
warn: true
})
]
if (process.env.NODE_ENV === "development") {
module.exports = {
...module.exports,
plugins: [
new FlowFlowPlugin({
warn: true,
}),
]
};
}