From dd77312133ec5c236e958752df7a3d4c7c4f02ee Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 13 Dec 2015 15:29:40 +0000 Subject: [PATCH] Use ESLint and the AirBnB style guide To help enforce a consistent JS code style and improve code quality by catching various syntax gotchas. I'm editing in Atom with the linter-eslint package installed, and it gives me inline warnings and errors, very handy. I'm not going to run ESLint on Travis (yet) though, as it spits out far too many errors for it to be useful. --- .eslintrc.yml | 22 ++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 .eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..53d7b43b --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,22 @@ +env: + es6: true + mocha: true + amd: true + node: true + browser: true + +ecmaFeatures: + modules: false + +globals: + loot: false + +extends: + - "eslint:recommended" + - "airbnb/base" + +rules: + strict: + - 2 + - global + no-new: 1 diff --git a/package.json b/package.json index 2ee8b1f9..a92de249 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "private": true, "devDependencies": { "bower": "^1.7.1", + "eslint": "^1.10.3", + "eslint-config-airbnb": "^2.0.0", "fs-extra": "^0.26.2", "vulcanize": "^0.7.11" }