Skip to content

Commit 2cb9278

Browse files
committed
ESLint added to the workflow
1 parent bc4de92 commit 2cb9278

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "nodesecurity"
3+
}

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,18 @@ Add the following to your `.eslintrc` file:
3232
- `detect-possible-timing-attacks` - Detects insecure comparisons (== != !== ===)
3333
- `detect-pseudoRandomBytes` - Detects if pseudoRandomBytes() is in use
3434

35-
### Tests
3635

36+
## Developer guide
37+
38+
- Use [GitHub pull requests](https://help.github.com/articles/using-pull-requests).
39+
- Conventions:
40+
- We use our [custom ESLint setup](https://github.com/nodesecurity/eslint-config-nodesecurity).
41+
- Please implement a test for each new rule and use this command to be sure the new code respects the style guide and the tests keep passing:
42+
```sh
43+
npm run-script cont-int
44+
```
45+
46+
### Tests
3747
```sh
3848
npm test
3949
```

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Security rules for eslint",
55
"main": "index.js",
66
"scripts": {
7-
"test": "./node_modules/.bin/mocha test/**/*"
7+
"test": "./node_modules/.bin/mocha test/**/*",
8+
"lint": "./node_modules/.bin/eslint .",
9+
"cont-int": "npm test && npm run-script lint"
810
},
911
"repository": {
1012
"type": "git",
@@ -25,7 +27,8 @@
2527
"safe-regex": "^1.1.0"
2628
},
2729
"devDependencies": {
28-
"eslint": "^1.8.0",
30+
"eslint": "^2.10.1",
31+
"eslint-config-nodesecurity": "^1.3.1",
2932
"mocha": "^2.4.5"
3033
}
3134
}

0 commit comments

Comments
 (0)