From 08dfac8b53321b01702356a2d0170b0efa256ebe Mon Sep 17 00:00:00 2001 From: sveisvei Date: Sat, 18 Jun 2016 21:13:57 +0200 Subject: [PATCH] eslint config --- .editorconfig | 4 ++-- .eslintrc | 23 ++----------------- package.json | 6 ++--- packages/unleash-api/.eslintrc | 10 ++++++++ packages/unleash-api/test/.eslintrc | 20 +++------------- packages/unleash-docker/.eslintrc | 6 +++++ packages/unleash-docker/package.json | 3 +++ packages/unleash-frontend/.eslintrc | 7 ++++++ packages/unleash-frontend/public/.eslintrc | 12 ++++++++-- .../public/js/__tests__/.eslintrc | 18 +++++---------- packages/unleash-server/.eslintrc | 6 +++++ 11 files changed, 58 insertions(+), 57 deletions(-) create mode 100644 packages/unleash-api/.eslintrc create mode 100644 packages/unleash-docker/.eslintrc create mode 100644 packages/unleash-frontend/.eslintrc create mode 100644 packages/unleash-server/.eslintrc diff --git a/.editorconfig b/.editorconfig index 1dd414b330..afff24bb76 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,11 +6,11 @@ charset = utf-8 end_of_line = lf indent_style = space indent_size = 4 -insert_final_newline = false +insert_final_newline = true trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false [*.json] -indent_size = 2 \ No newline at end of file +indent_size = 2 diff --git a/.eslintrc b/.eslintrc index d67abcd0d2..5b1068a0b9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,24 +1,5 @@ { "extends": [ - "spt", - "spt/env-node", - "spt/env-es6-false", - "spt/env-react" - ], - "env": { - "browser": true - }, - "rules": { - "quotes": 0, - "strict": 0, - "vars-on-top": 0, - "no-use-before-define": 0, - "dot-notation": 0, - "eqeqeq": 0, - "no-eq-null": 0, - "no-undefined": 0, - "no-else-return": 0, - "no-shadow": 0, - "consistent-this": 0 - } + "finn" + ] } \ No newline at end of file diff --git a/package.json b/package.json index d36fb6c5f6..00a979cdaa 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "scripts": { "bootstrap": "lerna bootstrap", "prepublish": "npm run bootstrap", - "lint": "lerna exec eslint .", + "lint": "node node_modules/eslint/bin/eslint.js packages --fix --ignore-pattern=node_modules --ext=js,jsx", "pre-commit": "echo 'no lint check' && exit 0;", "test": "lerna --concurrency=1 exec npm run test", "test:ci": "lerna --concurrency=1 exec npm run test:ci", @@ -33,8 +33,8 @@ }, "dependencies": {}, "devDependencies": { - "eslint": "^2.0.0", - "eslint-config-finn": "^1.0.0-alpha.3", + "eslint": "^2.12.0", + "eslint-config-finn": "finn-no/eslint-config-finn#master", "eslint-plugin-react": "^4.3.0", "lerna": "2.0.0-beta.20", "nsp": "^2.3.2", diff --git a/packages/unleash-api/.eslintrc b/packages/unleash-api/.eslintrc new file mode 100644 index 0000000000..069ac36969 --- /dev/null +++ b/packages/unleash-api/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + "finn", + "finn/es6", + "finn/node" + ], + "rules": { + "max-nested-callbacks": [0] + } +} diff --git a/packages/unleash-api/test/.eslintrc b/packages/unleash-api/test/.eslintrc index 57f8cbb6a3..4413073ce1 100644 --- a/packages/unleash-api/test/.eslintrc +++ b/packages/unleash-api/test/.eslintrc @@ -1,20 +1,6 @@ { - "extends": [ - "spt", - "spt/env-node", - "spt/env-es6-false" - ], "env": { - "browser": true - }, - "globals": { - "it": false, - "beforeEach": false, - "describe": false - }, - "rules": { - "quotes": 0, - "vars-on-top": 0, - "max-nested-callbacks": 0 + "browser": true, + "mocha": true } -} \ No newline at end of file +} diff --git a/packages/unleash-docker/.eslintrc b/packages/unleash-docker/.eslintrc new file mode 100644 index 0000000000..8f68bb4a87 --- /dev/null +++ b/packages/unleash-docker/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": [ + "finn", + "finn/node" + ] +} diff --git a/packages/unleash-docker/package.json b/packages/unleash-docker/package.json index d8c3b01a56..7ecb531f96 100644 --- a/packages/unleash-docker/package.json +++ b/packages/unleash-docker/package.json @@ -9,6 +9,9 @@ "db-migrate": "db-migrate up", "test:ci": "echo 'no tests for unleash-docker';" }, + "engines": { + "node": "6" + }, "author": "", "license": "ISC", "dependencies": { diff --git a/packages/unleash-frontend/.eslintrc b/packages/unleash-frontend/.eslintrc new file mode 100644 index 0000000000..e04e2c14ed --- /dev/null +++ b/packages/unleash-frontend/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": [ + "finn", + "finn/es6", + "finn/node" + ] +} diff --git a/packages/unleash-frontend/public/.eslintrc b/packages/unleash-frontend/public/.eslintrc index 46d7c9bddf..779f8de2b0 100644 --- a/packages/unleash-frontend/public/.eslintrc +++ b/packages/unleash-frontend/public/.eslintrc @@ -1,6 +1,14 @@ { "extends": [ "finn", + "finn/es6", "finn/react" - ] -} \ No newline at end of file + ], + "env": { + "browser": true, + "commonjs": true + }, + "rules": { + "react/sort-comp": [0] + } +} diff --git a/packages/unleash-frontend/public/js/__tests__/.eslintrc b/packages/unleash-frontend/public/js/__tests__/.eslintrc index 7d89fc81f0..b1c8a98ed5 100644 --- a/packages/unleash-frontend/public/js/__tests__/.eslintrc +++ b/packages/unleash-frontend/public/js/__tests__/.eslintrc @@ -1,11 +1,12 @@ { "extends": [ - "spt", - "spt/env-node", - "spt/env-es6-false" + "finn", + "finn/node", + "finn/es6" ], "env": { - "browser": true + "browser": true, + "mocha": true }, "globals": { "it": false, @@ -14,12 +15,5 @@ "expect": false, "describe": false, "afterEach": false - }, - "rules": { - "quotes": 0, - "strict": 0, - "vars-on-top": 0, - "no-undefined": 0, - "no-shadow": 0 } -} \ No newline at end of file +} diff --git a/packages/unleash-server/.eslintrc b/packages/unleash-server/.eslintrc new file mode 100644 index 0000000000..88b8a0343d --- /dev/null +++ b/packages/unleash-server/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": [ + "finn", + "finn/node" + ] +} \ No newline at end of file