summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.eslintrc15
-rw-r--r--init.js2
-rw-r--r--package.json2
-rw-r--r--scripts/serve.js63
4 files changed, 45 insertions, 37 deletions
diff --git a/.eslintrc b/.eslintrc
index fdb929fb1d..0f54d38f8b 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,9 +1,14 @@
{
+ "root": true,
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:promise/recommended",
- "prettier"
+ "plugin:flowtype/recommended",
+ "prettier",
+ "prettier/flowtype",
+ "prettier/react",
+ "prettier/standard"
],
"parser": "babel-eslint",
"parserOptions": {
@@ -12,15 +17,17 @@
"modules": true
}
},
- "plugins": ["react", "flowtype", "promise"],
+ "plugins": [
+ "react",
+ "flowtype",
+ "promise"
+ ],
"rules": {
"prefer-const": "warn",
"no-console": "off",
"no-loop-func": "warn",
- "new-cap": "off",
"no-param-reassign": "warn",
"func-names": "off",
- "comma-spacing": "warn",
"no-unused-expressions": "error",
"no-unused-vars": [
"error",
diff --git a/init.js b/init.js
index 0304e4341a..e489d4ef8e 100644
--- a/init.js
+++ b/init.js
@@ -1 +1 @@
-require('./build/main'); \ No newline at end of file
+require('./build/main');
diff --git a/package.json b/package.json
index 86f9d0cb3c..f2aa5b4425 100644
--- a/package.json
+++ b/package.json
@@ -90,6 +90,6 @@
"private:serve": "cross-env BABEL_ENV=electron babel-node scripts/serve.js",
"private:compile": "babel app/ --copy-files --out-dir build",
"private:clean": "rimraf build",
- "private:format": "cross-env prettier 'app/**/*.js' 'test/**/*.js'"
+ "private:format": "cross-env prettier 'app/**/*.js' 'test/**/*.js' 'scripts/*.js'"
}
}
diff --git a/scripts/serve.js b/scripts/serve.js
index b658b0dc70..03abeab2c2 100644
--- a/scripts/serve.js
+++ b/scripts/serve.js
@@ -15,38 +15,39 @@ const getClientUrl = (options) => {
return getRootUrl(options) + pathname;
};
-bsync.init({
- ui: false,
- // Port 35829 = LiveReload's default port 35729 + 100.
- // If the port is occupied, Browsersync uses next free port automatically.
- port: 35829,
- ghostMode: false,
- open: false,
- notify: false,
- logSnippet: false,
- socket: {
- // Use the actual port here.
- domain: getRootUrl
- }
-}, (err, bs) => {
- if (err) return console.error(err);
+bsync.init(
+ {
+ ui: false,
+ // Port 35829 = LiveReload's default port 35729 + 100.
+ // If the port is occupied, Browsersync uses next free port automatically.
+ port: 35829,
+ ghostMode: false,
+ open: false,
+ notify: false,
+ logSnippet: false,
+ socket: {
+ // Use the actual port here.
+ domain: getRootUrl,
+ },
+ },
+ (err, bs) => {
+ if (err) return console.error(err);
- const child = spawn(electron, ['.'], {
- env: {
- ...{
- NODE_ENV: 'development',
- BROWSER_SYNC_CLIENT_URL: getClientUrl(bs.options)
+ const child = spawn(electron, ['.'], {
+ env: {
+ ...{
+ NODE_ENV: 'development',
+ BROWSER_SYNC_CLIENT_URL: getClientUrl(bs.options),
+ },
+ ...process.env,
},
- ...process.env
- },
- stdio: 'inherit'
- });
+ stdio: 'inherit',
+ });
- child.on('close', () => {
- process.exit();
- });
+ child.on('close', () => {
+ process.exit();
+ });
- bsync
- .watch('build/**/*')
- .on('change', bsync.reload);
-});
+ bsync.watch('build/**/*').on('change', bsync.reload);
+ },
+);