diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..a6c57f5f --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +*.json diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..17350214 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,34 @@ +{ + "env": { + "node": true, + "browser": true, + "mocha": true, + "commonjs": true + }, + + "extends": "eslint:recommended", + + "rules": { + "indent": [ + "error", + 4, + { SwitchCase: 1 } + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ], + "strict": 2, + "no-unused-vars": 2, + "no-cond-assign": 2, + "camelcase": 1 + } +} diff --git a/.npmignore b/.npmignore index 9daeafb9..8cd94105 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,2 @@ test +.eslint* diff --git a/package.json b/package.json index 01f90ff1..a812919b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "author": "Mark ", "main": "index.js", "scripts": { - "test": "mocha" + "test": "mocha", + "lint": "eslint index.js \"lib/**\" \"test/**\"" }, "repository": { "type": "git", @@ -26,6 +27,7 @@ "htmlparser2": "^3.9.1" }, "devDependencies": { + "eslint": "^3.3.1", "jsdomify": "^2.1.0", "mocha": "^3.0.2", "react": "^15.3.0",