Skip to content

Commit

Permalink
Use blint for linting, rather than in-tree tool
Browse files Browse the repository at this point in the history
(Blint is the in-tree tool factored into its own npm package.)
  • Loading branch information
marijnh committed Jan 14, 2015
1 parent 78e06ac commit 643d9c0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2,284 deletions.
15 changes: 1 addition & 14 deletions bin/lint
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
#!/usr/bin/env node

var lint = require("../test/lint/lint"),
path = require("path");

if (process.argv.length > 2) {
lint.checkDir(process.argv[2]);
} else {
process.chdir(path.resolve(__dirname, ".."));
lint.checkDir("lib");
lint.checkDir("mode");
lint.checkDir("addon");
lint.checkDir("keymap");
}

process.exit(lint.success() ? 0 : 1);
process.exit(require("../test/lint").ok ? 0 : 1);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"directories": {"lib": "./lib"},
"scripts": {"test": "node ./test/run.js"},
"devDependencies": {"node-static": "0.6.0",
"phantomjs": "1.9.2-5"},
"phantomjs": "1.9.2-5",
"blint": "^0.1.0"},
"bugs": "http://github.com/codemirror/CodeMirror/issues",
"keywords": ["JavaScript", "CodeMirror", "Editor"],
"homepage": "http://codemirror.net",
Expand Down
11 changes: 11 additions & 0 deletions test/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var blint = require("blint");

["mode", "lib", "addon", "keymap"].forEach(function(dir) {
blint.checkDir(dir, {
browser: true,
allowedGlobals: ["CodeMirror", "define", "test", "requirejs"],
blob: "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http:\/\/codemirror.net\/LICENSE\n\n"
});
});

module.exports = {ok: blint.success()};
Loading

0 comments on commit 643d9c0

Please sign in to comment.