From 0f1f52e3e43917c19c2c6dbf3c426ec933153e0c Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 22 Aug 2018 20:13:25 -0700 Subject: [PATCH] Adjust eslint configuration --- web3.js/.eslintrc | 17 ------------ web3.js/.eslintrc.js | 61 ++++++++++++++++++++++++++++++++++++++++++++ web3.js/package.json | 1 - 3 files changed, 61 insertions(+), 18 deletions(-) delete mode 100644 web3.js/.eslintrc create mode 100644 web3.js/.eslintrc.js diff --git a/web3.js/.eslintrc b/web3.js/.eslintrc deleted file mode 100644 index d77f5a5a95..0000000000 --- a/web3.js/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "airbnb", - "parser": "babel-eslint", - - "env": { - "mocha": true - }, - - "rules": { - "linebreak-style": 0, - "import/no-extraneous-dependencies": 0, - "import/no-unresolved": 0, - "import/prefer-default-export": 0, - "import/extensions": 0, - "no-multi-spaces": 0 - } -} \ No newline at end of file diff --git a/web3.js/.eslintrc.js b/web3.js/.eslintrc.js new file mode 100644 index 0000000000..336a7c8d59 --- /dev/null +++ b/web3.js/.eslintrc.js @@ -0,0 +1,61 @@ +module.exports = { // eslint-disable-line import/no-commonjs + 'env': { + 'browser': true, + 'es6': true, + 'node': true, + }, + 'extends': [ + 'eslint:recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + ], + 'parser': 'babel-eslint', + 'parserOptions': { + 'sourceType': 'module', + 'ecmaVersion': 8, + }, + 'rules': { + 'no-trailing-spaces': [ + 'error', + ], + 'import/first': [ + 'error', + ], + 'import/no-commonjs': [ + 'error', + ], + 'import/order': [ + 'error', + { + 'groups': [ + ['internal', 'external', 'builtin'], + ['index', 'sibling', 'parent'] + ], + 'newlines-between': 'always', + }, + ], + 'indent': [ + 'error', + 2, + {'MemberExpression': 0}, + ], + 'linebreak-style': [ + 'error', + 'unix', + ], + 'no-console': [ + 0 + ], + 'quotes': [ + 'error', + 'single', {'avoidEscape': true, 'allowTemplateLiterals': true}, + ], + 'require-await': [ + 'error' + ], + 'semi': [ + 'error', + 'always', + ], + }, +}; diff --git a/web3.js/package.json b/web3.js/package.json index 98fd48e79d..54d7b7e623 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -55,7 +55,6 @@ "esdoc-importpath-plugin": "^1.0.2", "esdoc-standard-plugin": "^1.0.0", "eslint": "4.19.1", - "eslint-config-airbnb": "16.1.0", "eslint-plugin-import": "2.11.0", "eslint-plugin-jsx-a11y": "^6.1.1", "eslint-plugin-react": "^7.11.1",