From dc8266759a203677745a4fd990a08bb3efea51f2 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Mon, 2 Nov 2020 22:26:51 +0200 Subject: [PATCH] Restore eslint configuration --- packages/concordia-app/.eslintrc.js | 46 ++++++++ packages/concordia-app/package.json | 11 +- packages/concordia-contracts/.eslintignore | 1 + packages/concordia-contracts/.eslintrc.js | 50 +++++++++ packages/concordia-contracts/.solhint.json | 3 + packages/concordia-contracts/package.json | 5 + yarn.lock | 116 ++++++++++++++------- 7 files changed, 188 insertions(+), 44 deletions(-) create mode 100644 packages/concordia-app/.eslintrc.js create mode 100644 packages/concordia-contracts/.eslintignore create mode 100644 packages/concordia-contracts/.eslintrc.js create mode 100644 packages/concordia-contracts/.solhint.json diff --git a/packages/concordia-app/.eslintrc.js b/packages/concordia-app/.eslintrc.js new file mode 100644 index 0000000..c2321b9 --- /dev/null +++ b/packages/concordia-app/.eslintrc.js @@ -0,0 +1,46 @@ +module.exports = { + 'env': { + 'browser': true, + 'es6': true, + 'jest': true + }, + 'extends': [ + 'plugin:react/recommended', + 'airbnb' + ], + 'globals': { + 'Atomics': 'readonly', + 'SharedArrayBuffer': 'readonly' + }, + 'parserOptions': { + 'ecmaFeatures': { + 'jsx': true + }, + 'ecmaVersion': 2018, + 'sourceType': 'module' + }, + 'plugins': [ + 'react' + ], + 'rules': { + "indent": ["error", 4], + "react/jsx-indent": ["error", 4], + "react/jsx-indent-props": ["error", 4], + 'react/jsx-filename-extension': 'off', + 'react/jsx-props-no-spreading': 'off', + 'import/extensions': 'off', + 'react/require-default-props': 'off', + 'react/prop-types': 'off', + 'max-len': ['warn', {'code': 120, 'tabWidth': 4}], + 'no-unused-vars': 'warn', + 'no-console': 'warn', + 'no-shadow': 'warn', + }, + 'settings': { + 'import/resolver': { + 'node': { + 'extensions': ['.js', '.jsx'] + } + } + }, +}; diff --git a/packages/concordia-app/package.json b/packages/concordia-app/package.json index 53a2c0b..65c1b25 100644 --- a/packages/concordia-app/package.json +++ b/packages/concordia-app/package.json @@ -8,10 +8,8 @@ "test": "react-scripts test", "eject": "react-scripts eject", "postinstall": "patch-package", - "analyze": "source-map-explorer 'build/static/js/*.js'" - }, - "eslintConfig": { - "extends": "react-app" + "analyze": "source-map-explorer 'build/static/js/*.js'", + "lint": "yarn run eslint . --format table" }, "browserslist": { "production": [ @@ -45,6 +43,11 @@ "web3": "1.3.0" }, "devDependencies": { + "eslint": "6.8.0", + "eslint-config-airbnb": "18.1.0", + "eslint-plugin-import": "2.20.2", + "eslint-plugin-jsx-a11y": "6.2.3", + "eslint-plugin-react": "7.19.0", "patch-package": "~6.2.2", "postinstall-postinstall": "~2.1.0", "source-map-explorer": "~2.5.0" diff --git a/packages/concordia-contracts/.eslintignore b/packages/concordia-contracts/.eslintignore new file mode 100644 index 0000000..a007fea --- /dev/null +++ b/packages/concordia-contracts/.eslintignore @@ -0,0 +1 @@ +build/* diff --git a/packages/concordia-contracts/.eslintrc.js b/packages/concordia-contracts/.eslintrc.js new file mode 100644 index 0000000..8261734 --- /dev/null +++ b/packages/concordia-contracts/.eslintrc.js @@ -0,0 +1,50 @@ +module.exports = { + 'env': { + 'browser': true, + 'es6': true, + 'jest': true + }, + 'extends': [ + 'plugin:react/recommended', + 'airbnb' + ], + 'globals': { + 'Atomics': 'readonly', + 'SharedArrayBuffer': 'readonly', + 'artifacts': 'readonly', + 'require': 'readonly', + 'contract': 'readonly', + 'assert': 'readonly' + }, + 'parserOptions': { + 'ecmaFeatures': { + 'jsx': true + }, + 'ecmaVersion': 2018, + 'sourceType': 'module' + }, + 'plugins': [ + 'react' + ], + 'rules': { + "indent": ["error", 4], + "react/jsx-indent": ["error", 4], + "react/jsx-indent-props": ["error", 4], + 'react/jsx-filename-extension': 'off', + 'react/jsx-props-no-spreading': 'off', + 'import/extensions': 'off', + 'react/require-default-props': 'off', + 'react/prop-types': 'off', + 'max-len': ['warn', {'code': 120, 'tabWidth': 4}], + 'no-unused-vars': 'warn', + 'no-console': 'warn', + 'no-shadow': 'warn', + }, + 'settings': { + 'import/resolver': { + 'node': { + 'extensions': ['.js', '.jsx'] + } + } + }, +}; diff --git a/packages/concordia-contracts/.solhint.json b/packages/concordia-contracts/.solhint.json new file mode 100644 index 0000000..d7c3de9 --- /dev/null +++ b/packages/concordia-contracts/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:default" +} diff --git a/packages/concordia-contracts/package.json b/packages/concordia-contracts/package.json index 373e3b2..8ef2107 100644 --- a/packages/concordia-contracts/package.json +++ b/packages/concordia-contracts/package.json @@ -17,6 +17,11 @@ "truffle": "~5.1.45" }, "devDependencies": { + "eslint": "6.8.0", + "eslint-config-airbnb": "18.1.0", + "eslint-plugin-import": "2.20.2", + "eslint-plugin-jsx-a11y": "6.2.3", + "eslint-plugin-react": "7.19.0", "solhint": "~3.2.0" } } diff --git a/yarn.lock b/yarn.lock index 7c283b6..c651b92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5843,6 +5843,24 @@ escodegen@^1.11.0, escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" +eslint-config-airbnb-base@^14.1.0: + version "14.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" + integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q== + dependencies: + confusing-browser-globals "^1.0.9" + object.assign "^4.1.0" + object.entries "^1.1.2" + +eslint-config-airbnb@18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.1.0.tgz#724d7e93dadd2169492ff5363c5aaa779e01257d" + integrity sha512-kZFuQC/MPnH7KJp6v95xsLBf63G/w7YqdPfQ0MUanxQ7zcKUNG8j+sSY860g3NwCBOa62apw16J6pRN+AOgXzw== + dependencies: + eslint-config-airbnb-base "^14.1.0" + object.assign "^4.1.0" + object.entries "^1.1.1" + eslint-config-react-app@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.1.tgz#698bf7aeee27f0cea0139eaef261c7bf7dd623df" @@ -5902,6 +5920,24 @@ eslint-plugin-import@2.20.1: read-pkg-up "^2.0.0" resolve "^1.12.0" +eslint-plugin-import@2.20.2: + version "2.20.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz#91fc3807ce08be4837141272c8b99073906e588d" + integrity sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg== + dependencies: + array-includes "^3.0.3" + array.prototype.flat "^1.2.1" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.1" + has "^1.0.3" + minimatch "^3.0.4" + object.values "^1.1.0" + read-pkg-up "^2.0.0" + resolve "^1.12.0" + eslint-plugin-jsx-a11y@6.2.3: version "6.2.3" resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" @@ -5975,90 +6011,90 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== -eslint@^5.6.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@6.8.0, eslint@^6.6.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" + glob-parent "^5.0.0" + globals "^12.1.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.11" + lodash "^4.17.14" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" + optionator "^0.8.3" progress "^2.0.0" regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" table "^5.2.3" text-table "^0.2.0" + v8-compile-cache "^2.0.3" -eslint@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== +eslint@^5.6.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" + ajv "^6.9.1" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" + glob "^7.1.2" + globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" + inquirer "^6.2.2" + js-yaml "^3.13.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.14" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.3" + optionator "^0.8.2" + path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" table "^5.2.3" text-table "^0.2.0" - v8-compile-cache "^2.0.3" espree@^5.0.1: version "5.0.1" @@ -11949,7 +11985,7 @@ object.assign@^4.1.0: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.0, object.entries@^1.1.1: +object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.2.tgz#bc73f00acb6b6bb16c203434b10f9a7e797d3add" integrity sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==