.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
This commit is contained in:
Bryan Housel
2016-07-19 11:50:08 -04:00
parent 604d1e2719
commit 26c274f91c
3 changed files with 60 additions and 70 deletions

114
.eslintrc
View File

@@ -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"]
}
}

View File

@@ -1,15 +0,0 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
extends: [
"plugin:import/errors"
],
rules: {
"no-invalid-this": 0
},
globals: {
"iD": false,
}
}

View File

@@ -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",