Permalink
Browse files

Fixing things because NPM jslint module broke my shit.

  • Loading branch information...
1 parent 8f03075 commit 0fa4da2150cd4cdf1e3b48770f1d3600711c5f9c @arthurakay committed Nov 4, 2013
View
@@ -1,6 +1,10 @@
===============
VERSION 2.x
===============
+Version 2.3.4 (November 4, 2013)
+ - Bug fixes for JSLint dependency
+ - Code cleanup
+
Version 2.3.3 (June 10, 2013)
- Added getVersion() method and outputting value to console
- Now allowing logFile config to accept a string (backwards compatibility to <v2.3)
View
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title></title>
+ <title>Test</title>
</head>
<body>
<img src="some_image.jpg" alt="An img element must have an alt attribute, except under certain conditions." />
View
@@ -7,6 +7,9 @@ var config = {
verbose : false,
stopOnFirstError : false,
+ //only check JS files
+ regex : /\.(js)$/i,
+
//recursively include JS files in these folders
filepaths : [
'../'
@@ -25,6 +28,7 @@ var config = {
options : {
sloppy : false,
node : true,
+ todo : true,
predef : [
'describe',
@@ -54,10 +58,10 @@ var config = {
},
{
type : 'esprima'
- },
- {
- type : 'w3c_html'
}
+// {
+// type : 'w3c_html'
+// }
]
};
View
@@ -1,7 +1,7 @@
{
"name" : "lintroller",
"preferGlobal" : "true",
- "version" : "2.3.3",
+ "version" : "2.3.4",
"author" : "Arthur Kay <art@akawebdesign.com>",
"description" : "Lint your JavaScript and HTML code and output errors to a log file. Convenient for pre-commit hooks and build systems to maintain code quality.",
View
@@ -30,7 +30,7 @@
*/
"use strict";
-var version = '2.3.3';
+var version = '2.3.4';
var LintRoller = {
/**
@@ -127,7 +127,8 @@ var LintRoller = {
* @private
*/
initConfigs : function (config) {
- var i;
+ var i,
+ logFile;
if (!config) {
return false;
@@ -139,7 +140,7 @@ var LintRoller = {
this.setLinters(config[i]);
}
else if (i === 'logFile') {
- var logFile = config[i];
+ logFile = config[i];
if (logFile === null) {
delete this.logFile;
@@ -238,17 +239,19 @@ var LintRoller = {
path = pathConfig; //should be an array of strings
}
+ var currPath, exclude, j,
+ list, x;
+
for (i; i < path.length; i++) {
- var currPath = path[i];
- var exclude = false;
+ currPath = path[i];
+ exclude = false;
this.log('\n*** currPath: ' + currPath);
if (this.exclusions) {
this.log('Checking exclusion paths...');
- var j = 0;
- for (j; j < this.exclusions.length; j++) {
+ for (j = 0; j < this.exclusions.length; j++) {
if (currPath === this.exclusions[j]) {
exclude = true;
}
@@ -268,10 +271,9 @@ var LintRoller = {
else {
this.log(currPath + ' is a directory. Running parseFile() on all contained files...');
- var list = this.getFiles(currPath);
- var x = 0;
+ list = this.getFiles(currPath);
- for (x; x < list.length; x++) {
+ for (x = 0; x < list.length; x++) {
this.parseFile(currPath, list[x]);
}
}
@@ -348,7 +350,7 @@ var LintRoller = {
);
},
- function (e) {
+ function () {
errorList.totalErrors = errors;
if (errors > 0) {
View
@@ -1,5 +1,5 @@
"use strict";
-var JSLINT = require('jslint');
+var JSLINT = require('jslint')();
/**
* @class LintRoller.linters.JSLint
View
@@ -61,9 +61,11 @@ var linter = {
file : file,
output : 'json',
callback : function (error) {
+ var err;
+
if (error) {
for (i = 0; i < error.messages.length; i++) {
- var err = error.messages[i];
+ err = error.messages[i];
if (err.type === 'error') {
errorList.push({
View
@@ -189,18 +189,18 @@ var util = {
offendingFiles = [],
file, js;
+ var i, result, totalErrors, error;
+
for (j; j < this.parent.files.length; j++) {
file = this.parent.files[j];
js = this.parent.fs.readFileSync(file, 'utf8');
- var i = 0,
- result = linter(js, options),
- totalErrors = linter.errors.length,
- error;
+ result = linter(js, options);
+ totalErrors = linter.errors.length;
if (!result) {
- for (i; i < totalErrors; i++) {
+ for (i = 0; i < totalErrors; i++) {
error = linter.errors[i];
if (error && error.reason === msg) {
View
@@ -34,7 +34,7 @@ jasmine.executeSpecsInFolder({
isVerbose : isVerbose,
showColors : showColors,
- onComplete : function (runner, log) {
+ onComplete : function (runner) {
if (runner.results().failedCount === 0) {
process.exit(0);
}
View
@@ -19,9 +19,9 @@ describe('LintRoller', function () {
expect(LintRoller).toNotEqual(undefined);
});
- describe('init()', function () {
- //TODO: can a useful test be written?
- });
+// describe('init()', function () {
+// //TODO: can a useful test be written?
+// });
describe('getVersion()', function () {
it('should return a string version number', function () {
@@ -113,42 +113,42 @@ describe('LintRoller', function () {
});
});
- describe('announceErrors()', function () {
- //TODO: can a useful test be written?
- });
-
- describe('announceSuccess()', function () {
- //TODO: can a useful test be written?
- });
-
- describe('getFiles()', function () {
- //This method just returns the result of fs.readdirSync() and logs output to the terminal
- //I probably don't need to test this
- });
+// describe('announceErrors()', function () {
+// //TODO: can a useful test be written?
+// });
- describe('parseTree()', function () {
+// describe('announceSuccess()', function () {
+// //TODO: can a useful test be written?
+// });
- });
+// describe('getFiles()', function () {
+// //This method just returns the result of fs.readdirSync() and logs output to the terminal
+// //I probably don't need to test this
+// });
- describe('lintFiles()', function () {
- //TODO: can a useful test be written? Or do we simply test the ACTUAL linters?
- });
+// describe('parseTree()', function () {
+//
+// });
- describe('logToFile()', function () {
- //TODO: can a useful test be written?
- });
+// describe('lintFiles()', function () {
+// //TODO: can a useful test be written? Or do we simply test the ACTUAL linters?
+// });
- describe('logToStdOut()', function () {
- //TODO: can a useful test be written?
- });
+// describe('logToFile()', function () {
+// //TODO: can a useful test be written?
+// });
- describe('formatTextOutput()', function () {
+// describe('logToStdOut()', function () {
+// //TODO: can a useful test be written?
+// });
- });
+// describe('formatTextOutput()', function () {
+//
+// });
- describe('clearLogFile()', function () {
- //TODO: can a useful test be written?
- });
+// describe('clearLogFile()', function () {
+// //TODO: can a useful test be written?
+// });
describe('log()', function () {
@@ -4,13 +4,13 @@ describe('LintRoller - jsHint module', function () {
var JSHINT = require('../../../src/linters/jshint');
//SETUP / TEARDOWN
- beforeEach(function () {
+// beforeEach(function () {
+//
+// });
- });
-
- afterEach(function () {
-
- });
+// afterEach(function () {
+//
+// });
//SPECS
@@ -26,9 +26,9 @@ describe('LintRoller - jsHint module', function () {
JSHINT.globals = {};
});
- afterEach(function () {
-
- });
+// afterEach(function () {
+//
+// });
var options = {
strict : true,

0 comments on commit 0fa4da2

Please sign in to comment.