Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-jslint

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-jslint - npm Package Compare versions

Comparing version 1.1.14 to 1.2.0

test/exclude.js~

23

lib/jslint.js

@@ -61,7 +61,20 @@

vm.runInContext(code, ctx);
//vm.runInContext(code, ctx);
var script = new vm.Script(code);
script.runInContext(ctx);
JSLINT = jslint.JSLINT = ctx.JSLINT;
jslint.edition = JSLINT.edition;
if (ctx.jslint) {
JSLINT = jslint.JSLINT = ctx.jslint;
jslint.edition = JSLINT("", {}).edition;
} else if (ctx.JSLINT) {
JSLINT = jslint.JSLINT = ctx.JSLINT;
jslint.edition = JSLINT.edition;
} else {
throw new Error("JSLint not found");
}
if (cb) {

@@ -183,3 +196,5 @@ cb(null, jslint.edition);

var violations = JSLINT.errors;
var violations = JSLINT.errors
? JSLINT.errors
: JSLINT.data().warnings;
var res = [];

@@ -186,0 +201,0 @@

7

lib/reporters/check-style.js

@@ -18,3 +18,6 @@

issues.forEach(function (issue) {
var msg = issue.reason || 'Unused variable "' + issue.name + '"';
var msg = issue.message || issue.reason || 'Unused variable "' + issue.name + '"';
var column = typeof issue.column === "number"
? issue.column
: issue.character;

@@ -24,3 +27,3 @@ xml.push([

' line="' + issue.line + '"',
' column="' + issue.character + '"',
' column="' + column + '"',
' severity="warning"',

@@ -27,0 +30,0 @@ ' message="' + util.escapeForXml(msg) + '"',

@@ -19,3 +19,6 @@

var reason = util.message(issue),
evidence = issue.evidence || '';
evidence = issue.evidence || '',
char = typeof issue.column === "number"
? issue.column
: issue.character;

@@ -25,3 +28,3 @@ xml.push([

' line="' + issue.line + '"',
' char="' + issue.character + '"',
' char="' + char + '"',
' reason="' + util.escapeForXml(reason) + '"',

@@ -28,0 +31,0 @@ ' evidence="' + util.escapeForXml(evidence) + '"',

@@ -26,3 +26,7 @@

+ ':'
+ (failure.character || '');
+ (
typeof failure.column === "number"
? failure.column
: failure.character
);

@@ -29,0 +33,0 @@ xml.push([

@@ -25,4 +25,6 @@

buf += red(file + ':' + issue.line);
if (issue.character) {
buf += red(':' + issue.character);
if (issue.column) {
buf += red(':' + issue.column);
} else if (issue.character) {
buf += red(':' + issue.character);
}

@@ -29,0 +31,0 @@ buf += '\t';

@@ -29,3 +29,3 @@

exports.message = function (issue) {
var msg = issue.reason || 'Unused variable "' + issue.name + '"';
var msg = issue.message || issue.reason || 'Unused variable "' + issue.name + '"';
return exports.escapeForXml(msg);

@@ -32,0 +32,0 @@ };

{
"name": "grunt-jslint",
"description": "Validates JavaScript files with JSLint",
"version": "1.1.14",
"version": "1.2.0",
"homepage": "https://github.com/stephenmathieson/grunt-jslint",

@@ -37,3 +37,3 @@ "author": {

"dependencies": {
"jslint": "~0.8.1"
"jslint": "^0.10.3"
},

@@ -45,4 +45,4 @@ "devDependencies": {

"jscoverage": "~0.5.9",
"vows": "~0.8.1",
"which": "~1.0.5",
"vows": "~0.9.0-rc3",
"which": "~1.2.14",
"win-spawn": "~2.0.0",

@@ -49,0 +49,0 @@ "xml2js": "~0.4.6"

@@ -11,3 +11,3 @@

task: 'jslint:server',
errors: 4
errors: 3
});

@@ -18,3 +18,3 @@

* var runner = require('./acceptance-runner');
*
*
* // a passing test

@@ -26,3 +26,3 @@ * var test = {

* runner(test);
*
*
* // a failing test with a custom grunt task

@@ -42,4 +42,4 @@ * var test = {

* runner(test);
*
*
*
* @api public

@@ -46,0 +46,0 @@ * @param {Object} opts

var thing=true;
var stuff=false;
var f=function(){
'use strict';
"use strict";

@@ -6,0 +6,0 @@ if(thing){

@@ -63,3 +63,3 @@ 'use strict';

assert.equal(violation.reason, '\'someglobal\' was used before it was defined.');
assert.equal(violation.message, 'Undeclared \'someglobal\'.');
}

@@ -147,9 +147,9 @@ }

report.forEach(function (issue) {
assert.ok(issue.id);
assert.ok(issue.raw);
assert.ok(issue.evidence);
assert.ok(issue.line);
assert.ok(issue.character);
assert.ok(issue.reason);
assert.ok(issue.file);
assert.ok(issue.name);//assert.ok(issue.id);
//assert.ok(issue.raw);
//assert.ok(issue.evidence);
assert.ok(typeof issue.line === "number");
assert.ok(issue.column);//assert.ok(issue.character);
assert.ok(issue.message);//assert.ok(issue.reason);
assert.ok(issue.file);
});

@@ -182,4 +182,5 @@ },

}
},
'sloppy': {
}
// NOTE: JSLint removed the ability to make "use strict" optional -- Skateside
/*'sloppy': {
topic: function () {

@@ -200,3 +201,3 @@ var file = getFixture('sloppy.js');

}
}
}*/
},

@@ -251,6 +252,6 @@

'should report on unused parameters': function (err, report) {
assert.equal(report[0].reason, 'Unused \'c\'.');
assert.equal(report[0].message, 'Unused \'c\'.');
},
'should report on unused vars': function (err, report) {
assert.equal(report[1].reason, 'Unused \'b\'.');
assert.equal(report[1].message, 'Unused \'b\'.');
}

@@ -257,0 +258,0 @@ },

@@ -18,8 +18,8 @@ /*jslint unparam:true*/

function validateIssue(issue) {
assert.ok(issue.id);
assert.ok(issue.raw);
assert.ok(issue.evidence);
assert.ok(issue.line);
assert.ok(issue.character);
assert.ok(issue.reason);
assert.ok(issue.name);//assert.ok(issue.id);
//assert.ok(issue.raw);
//assert.ok(issue.evidence);
assert.ok(typeof issue.line === "number");
assert.ok(issue.column);//assert.ok(issue.character);
assert.ok(issue.message);//assert.ok(issue.reason);
assert.ok(issue.file);

@@ -26,0 +26,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc