Skip to content

Commit 643d9c0

Browse files
committed
Use blint for linting, rather than in-tree tool
(Blint is the in-tree tool factored into its own npm package.)
1 parent 78e06ac commit 643d9c0

File tree

7 files changed

+15
-2284
lines changed

7 files changed

+15
-2284
lines changed

bin/lint

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
#!/usr/bin/env node
22

3-
var lint = require("../test/lint/lint"),
4-
path = require("path");
5-
6-
if (process.argv.length > 2) {
7-
lint.checkDir(process.argv[2]);
8-
} else {
9-
process.chdir(path.resolve(__dirname, ".."));
10-
lint.checkDir("lib");
11-
lint.checkDir("mode");
12-
lint.checkDir("addon");
13-
lint.checkDir("keymap");
14-
}
15-
16-
process.exit(lint.success() ? 0 : 1);
3+
process.exit(require("../test/lint").ok ? 0 : 1);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"directories": {"lib": "./lib"},
99
"scripts": {"test": "node ./test/run.js"},
1010
"devDependencies": {"node-static": "0.6.0",
11-
"phantomjs": "1.9.2-5"},
11+
"phantomjs": "1.9.2-5",
12+
"blint": "^0.1.0"},
1213
"bugs": "http://github.com/codemirror/CodeMirror/issues",
1314
"keywords": ["JavaScript", "CodeMirror", "Editor"],
1415
"homepage": "http://codemirror.net",

test/lint.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var blint = require("blint");
2+
3+
["mode", "lib", "addon", "keymap"].forEach(function(dir) {
4+
blint.checkDir(dir, {
5+
browser: true,
6+
allowedGlobals: ["CodeMirror", "define", "test", "requirejs"],
7+
blob: "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http:\/\/codemirror.net\/LICENSE\n\n"
8+
});
9+
});
10+
11+
module.exports = {ok: blint.success()};

0 commit comments

Comments
 (0)