From 26c274f91cbf8b94535e72aeb7d39c503246d1f2 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 19 Jul 2016 11:50:08 -0400 Subject: [PATCH] .eslint updates 1. combine into single root level .eslint file 2. remove sort imports rule 3. change no-undef to warning to catch uses of global iD 4. use text descriptions "off","warn","error" instead of numeric codes --- .eslintrc | 114 ++++++++++++++++++++++++---------------------- modules/.eslintrc | 15 ------ package.json | 1 - 3 files changed, 60 insertions(+), 70 deletions(-) delete mode 100644 modules/.eslintrc diff --git a/.eslintrc b/.eslintrc index b0825479a..4bd4d5d9b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,55 +1,12 @@ { - "extends": "eslint:recommended", - "rules": { - "dot-notation": 2, - "eqeqeq": [2, "smart"], - "indent": [0, 4], - "keyword-spacing": 2, - "linebreak-style": [2, "unix"], - "no-caller": 2, - "no-catch-shadow": 2, - "no-div-regex": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-floating-decimal": 2, - "no-implied-eval": 2, - "no-invalid-this": 2, - "no-iterator": 2, - "no-labels": 2, - "no-label-var": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-new": 2, - "no-new-func": 2, - "no-new-wrappers": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-process-env": 2, - "no-proto": 2, - "no-return-assign": 0, - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-shadow": 0, - "no-shadow-restricted-names": 2, - "no-throw-literal": 2, - "no-unneeded-ternary": 2, - "no-unused-expressions": 2, - "no-unexpected-multiline": 2, - "no-unused-vars": 1, - "no-void": 2, - "no-warning-comments": 1, - "no-with": 2, - "no-use-before-define": [0, "nofunc"], - "semi": [2, "always"], - "semi-spacing": 2, - "space-unary-ops": 2, - "wrap-regex": 0, - "quotes": [2, "single"] + "env": { + "browser": true, + "node": true, + "es6": true }, - + "extends": [ + "eslint:recommended" + ], "globals": { "d3": false, "t": false, @@ -57,9 +14,58 @@ "Diff3": false, "Mapillary": false, }, - - "env": { - "browser": true + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "rules": { + "dot-notation": "error", + "eqeqeq": ["error", "smart"], + "indent": ["off", 4], + "keyword-spacing": "error", + "linebreak-style": ["error", "unix"], + "no-caller": "error", + "no-catch-shadow": "error", + "no-div-regex": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-floating-decimal": "error", + "no-implied-eval": "error", + "no-invalid-this": "off", + "no-iterator": "error", + "no-labels": "error", + "no-label-var": "error", + "no-lone-blocks": "error", + "no-loop-func": "error", + "no-multi-str": "error", + "no-native-reassign": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-wrappers": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-process-env": "error", + "no-proto": "error", + "no-return-assign": "off", + "no-script-url": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow": "off", + "no-shadow-restricted-names": "error", + "no-throw-literal": "error", + "no-undef": "warn", // To catch uses of iD global - TODO remove + "no-unneeded-ternary": "error", + "no-unused-expressions": "error", + "no-unexpected-multiline": "error", + "no-unused-vars": "warn", + "no-void": "error", + "no-warning-comments": "warn", + "no-with": "error", + "no-use-before-define": ["off", "nofunc"], + "semi": ["error", "always"], + "semi-spacing": "error", + "space-unary-ops": "error", + "wrap-regex": "off", + "quotes": ["error", "single"] } - } diff --git a/modules/.eslintrc b/modules/.eslintrc deleted file mode 100644 index 17a861acc..000000000 --- a/modules/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - extends: [ - "plugin:import/errors" - ], - rules: { - "no-invalid-this": 0 - }, - globals: { - "iD": false, - } -} diff --git a/package.json b/package.json index baa787fb8..a1644e1d6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "d3": "3.5.5", "editor-layer-index": "git://github.com/osmlab/editor-layer-index.git#gh-pages", "eslint": "~3.1.1", - "eslint-plugin-import": "~1.11.0", "glob": "~7.0.5", "happen": "0.3.1", "http-server": "0.9.0",