From 0411ce26d33612d8c54222581f14daafe8c0b4c4 Mon Sep 17 00:00:00 2001 From: haad Date: Sun, 6 Mar 2016 17:00:01 +0100 Subject: [PATCH] Add ESLint (WIP) --- .eslintrc.json | 34 ++++++++++++++++++++++++++++++++++ README.md | 6 ++++++ package.json | 4 +++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..61d8c21 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,34 @@ +{ + "extends": "standard", + "plugins": [ + "standard" + ], + "ecmaFeatures": { + "modules": true + }, + "env": { + "es6": true, + "node": true + }, + "rules": { + "semi": [ 2, "always" ], + "quotes": [ 1, "single" ], + "no-undef": 0, + "global-strict": 0, + "no-extra-semi": 1, + "no-underscore-dangle": 0, + "no-console": 0, + "no-multi-spaces": 0, + "no-extra-bind": 0, + "curly": 0, + "no-use-before-define": 0, + "quotes": 0, + "no-unused-vars": 1, + "no-irregular-whitespace": 0, + "camelcase": 0, + "new-cap": 0, + "space-before-function-paren": 0, + "handle-callback-err": 0, + "keyword-spacing": 0 + } +} \ No newline at end of file diff --git a/README.md b/README.md index 3597980..1b44103 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,12 @@ Keep tests running while development: mocha -w ``` +#### Lint +*Work in progress! Throws an error "Parsing error: The keyword 'await' is reserved".* +``` +npm run lint +``` + ### TODO - Fix encryption - Caching diff --git a/package.json b/package.json index 1735449..2b2cbf2 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,11 @@ "socket.io-client": "1.3.7" }, "devDependencies": { + "eslint": "^2.3.0", "mocha": "^2.3.4" }, "scripts": { - "test": "mocha" + "test": "mocha", + "lint": "$(npm bin)/eslint ./src || true" } }