Skip to content

Commit

Permalink
Add ESLint as the default linter
Browse files Browse the repository at this point in the history
- Create `.eslintrc` and `.eslintignore`
- Add the above files to `.npmignore`
- Save `eslint` to devDependencies
- Create task `npm run lint` that lints `lib` and `test` directory

Documentation: http://eslint.org
  • Loading branch information
remarkablemark committed Aug 23, 2016
1 parent 9970b64 commit 9497215
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json
34 changes: 34 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -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
}
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
.eslint*
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "Mark <mark@remarkablemark.org>",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "mocha",
"lint": "eslint index.js \"lib/**\" \"test/**\""
},
"repository": {
"type": "git",
Expand All @@ -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",
Expand Down

0 comments on commit 9497215

Please sign in to comment.