diff --git a/.eslintrc b/.eslintrc index 22a0db488..e8bdcb6be 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,11 +4,11 @@ "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-empty-label": 2, "no-extend-native": 2, "no-extra-bind": 2, "no-floating-decimal": 2, @@ -45,7 +45,6 @@ "no-use-before-define": [0, "nofunc"], "semi": [2, "always"], "semi-spacing": 2, - "space-return-throw-case": 2, "space-unary-ops": 2, "wrap-regex": 0, "quotes": [2, "single"] diff --git a/js/id/id.js b/js/id/id.js index 050fdcc66..b81400115 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -23,7 +23,7 @@ window.iD = function () { if (arguments.length === 1) return storage.getItem(k); else if (v === null) storage.removeItem(k); else storage.setItem(k, v); - } catch(e) { + } catch (e) { // localstorage quota exceeded /* eslint-disable no-console */ if (typeof console !== 'undefined') console.error('localStorage quota exceeded'); diff --git a/js/id/modes/save.js b/js/id/modes/save.js index ad128ecb1..8cbd3e317 100644 --- a/js/id/modes/save.js +++ b/js/id/modes/save.js @@ -15,7 +15,7 @@ iD.modes.Save = function(context) { try { var cn = graph.childNodes(e); result.push.apply(result, _.map(_.filter(cn, 'version'), 'id')); - } catch(err) { + } catch (err) { /* eslint-disable no-console */ if (typeof console !== 'undefined') console.error(err); /* eslint-enable no-console */ diff --git a/modules/.eslintrc b/modules/.eslintrc new file mode 100644 index 000000000..f482330f6 --- /dev/null +++ b/modules/.eslintrc @@ -0,0 +1,6 @@ +{ + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + } +} diff --git a/package.json b/package.json index 76df2d108..d796e8799 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "test": "npm run lint && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html dot && make && phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index_packaged.html dot", "start": "http-server .", "lint": "eslint js/id && npm run lint:spec:actions", + "lint:modules": "eslint modules", "lint:spec:actions": "eslint test/spec/actions" }, "repository": { @@ -27,7 +28,7 @@ "chai": "~1.9.2", "d3": "3.5.5", "editor-layer-index": "git://github.com/osmlab/editor-layer-index.git#gh-pages", - "eslint": "^1.10.3", + "eslint": "^2.12.0", "glob": "~3.1.21", "happen": "0.1.2", "http-server": "^0.9.0",