Skip to content

Commit d8a762c

Browse files
committed
Add a bin/lint for easy running of the linter
1 parent 2700c8c commit d8a762c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CONTRIBUTING.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ should be asked on the
5656
test suite under `mode/XXX/test.js`. Feel free to add new test
5757
suites to modes that don't have one yet (be sure to link the new
5858
tests into `test/index.html`).
59+
- Follow the general code style of the rest of the project (see
60+
below). Run `bin/lint` to verify that the linter is happy.
5961
- Make sure all tests pass. Visit `test/index.html` in your browser to
6062
run them.
6163
- Submit a pull request
@@ -65,6 +67,6 @@ should be asked on the
6567

6668
- 2 spaces per indentation level, no tabs.
6769
- Include semicolons after statements.
68-
- Note that the linter (`test/lint/lint.js`) which is run after each
69-
commit complains about unused variables and functions. Prefix their
70-
names with an underscore to muffle it.
70+
- Note that the linter (`bin/lint`) which is run after each commit
71+
complains about unused variables and functions. Prefix their names
72+
with an underscore to muffle it.

bin/lint

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env node
2+
3+
var lint = require("../test/lint/lint");
4+
5+
process.chdir(__dirname.slice(0, __dirname.lastIndexOf("/")));
6+
7+
lint.checkDir("mode");
8+
lint.checkDir("lib");
9+
lint.checkDir("addon");
10+
11+
process.exit(lint.success() ? 0 : 1);

0 commit comments

Comments
 (0)