summaryrefslogtreecommitdiff
path: root/build-tools/lib/jslint/linter.js
diff options
context:
space:
mode:
Diffstat (limited to 'build-tools/lib/jslint/linter.js')
-rw-r--r--build-tools/lib/jslint/linter.js45
1 files changed, 0 insertions, 45 deletions
diff --git a/build-tools/lib/jslint/linter.js b/build-tools/lib/jslint/linter.js
deleted file mode 100644
index 1ba46e46..00000000
--- a/build-tools/lib/jslint/linter.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* original
-var JSLINT = require("../lib/nodelint");
- */
-var JSLINT = require("./nodelint");
-
-function addDefaults(options) {
- 'use strict';
- ['node', 'es5'].forEach(function (opt) {
- if (!options.hasOwnProperty(opt)) {
- options[opt] = true;
- }
- });
- return options;
-}
-
-exports.lint = function (script, options) {
- 'use strict';
- // remove shebang
- /*jslint regexp: true*/
- script = script.replace(/^\#\!.*/, "");
-
- options = options || {};
- delete options.argv;
- options = addDefaults(options);
-
- if (options.predef && !Array.isArray(options.predef)) {
- options.predef = options.predef.split(',')
- .filter(function (n) { return !!n; });
- }
-
- var ok = JSLINT(script, options),
- result = {
- ok: true,
- errors: []
- };
-
- if (!ok) {
- result = JSLINT.data();
- result.ok = ok;
- }
-
- result.options = options;
-
- return result;
-};