From a69992f6b2f546c21e0785788b457e7625a530a3 Mon Sep 17 00:00:00 2001 From: William Boman Date: Thu, 1 Oct 2015 00:15:19 +0200 Subject: [PATCH] Add .eslintrc --- .eslintignore | 3 +++ .eslintrc | 32 ++++++++++++++++++++++++++++++++ package.json | 4 +++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .eslintignore create mode 100644 .eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..3ff6b7b1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +client/js/libs.min.js +client/js/libs/**/*.js +client/js/shout.templates.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..78cb50d3 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,32 @@ +--- + +root: true + +env: + browser: true + mocha: true + node: true + +rules: + comma-dangle: 0 + curly: [2, multi-line] + eqeqeq: 2 + indent: [2, tab] + linebreak-style: [2, unix] + object-curly-spacing: [2, never] + semi: [2, always] + space-after-keywords: [2, always] + space-before-function-paren: [2, never] + spaced-comment: [2, always] + no-console: 0 + no-trailing-spaces: 2 + quotes: [2, double] + +globals: + $: false + Favico: false + Handlebars: false + io: false + Mousetrap: false + +extends: eslint:recommended diff --git a/package.json b/package.json index 87bd8451..582488fb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "scripts": { "start": "node index", "build": "grunt", - "test": "HOME=test/fixtures mocha test/**/*.js" + "test": "HOME=test/fixtures mocha test/**/*.js", + "lint": "eslint index.js Gruntfile.js src/ test/ client/ defaults/" }, "keywords": [ "browser", @@ -40,6 +41,7 @@ "socket.io": "~1.0.6" }, "devDependencies": { + "eslint": "^1.5.1", "grunt": "~0.4.5", "grunt-contrib-uglify": "~0.5.0", "grunt-contrib-watch": "^0.6.1",