From dfdaef1098494be754f5ac32d94a266d5a53336c Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Wed, 3 May 2017 22:49:08 -0700 Subject: [PATCH] Config and flow scripts --- .babelrc | 11 ++++++++--- .eslintrc | 38 ++++++++++++++++++++++---------------- package.json | 7 +++++-- yarn.lock | 4 ++++ 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/.babelrc b/.babelrc index 2963edac6..cfcb01298 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,8 @@ { - "presets": ["react", "env"], + "presets": [ + "react", + "env" + ], "plugins": [ "lodash", "transform-decorators-legacy", @@ -10,7 +13,9 @@ ], "env": { "development": { - "presets": ["react-hmre"] + "presets": [ + "react-hmre" + ] } } -} +} \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 2f3cc99a5..e36381a44 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,10 @@ { "parser": "babel-eslint", - "extends": ["react-app", "plugin:import/errors", "plugin:import/warnings"], + "extends": [ + "react-app", + "plugin:import/errors", + "plugin:import/warnings" + ], "plugins": [ "prettier" ], @@ -10,23 +14,25 @@ // does more harm than good. "no-mixed-operators": "off", // Enforce that code is formatted with prettier. - "prettier/prettier": ["error", {"trailingComma": "es5", "singleQuote": true}] - }, - "settings" : { - "import/resolver": { - "webpack": { - "config": "webpack.config.js" + "prettier/prettier": [ + "error", + { + "trailingComma": "es5", + "singleQuote": true } - } + ] + }, + "settings": { + "import/resolver": "webpack" }, "env": { - "jest": true, + "jest": true }, "globals": { - __DEV__: true, - SLACK_KEY: true, - SLACK_REDIRECT_URI: true, - DEPLOYMENT: true, - afterAll: true - }, -} + "__DEV__": true, + "SLACK_KEY": true, + "SLACK_REDIRECT_URI": true, + "DEPLOYMENT": true, + "afterAll": true + } +} \ No newline at end of file diff --git a/package.json b/package.json index 3d024f19f..72296a92d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "build": "npm run clean && npm run build:webpack", "start": "node index.js", "dev": "cross-env NODE_ENV=development DEBUG=sql,cache,presenters ./node_modules/.bin/nodemon --watch server index.js", - "lint": "eslint frontend", + "lint": "npm run lint:js && npm run lint:flow", + "lint:js": "eslint frontend", + "lint:flow": "flow check", "deploy": "git push heroku master", "heroku-postbuild": "npm run build && npm run sequelize db:migrate", "sequelize": "./node_modules/.bin/sequelize", @@ -92,6 +94,7 @@ "exports-loader": "0.6.3", "extract-text-webpack-plugin": "1.0.1", "file-loader": "0.9.0", + "flow": "^0.2.3", "highlight.js": "9.4.0", "history": "3.0.0", "html-webpack-plugin": "2.17.0", @@ -174,4 +177,4 @@ "react-addons-test-utils": "^15.3.1", "react-test-renderer": "^15.3.1" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 684c2631b..36ad258ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3036,6 +3036,10 @@ flow-parser@0.43.0: version "0.43.0" resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7" +flow@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/flow/-/flow-0.2.3.tgz#f8da65efa249127ec99376a28896572a9795d1af" + for-in@^0.1.5: version "0.1.6" resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8"