New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.11 to 1.1.12

test/acceptance/custom-edition.js

8

History.md

@@ -0,1 +1,9 @@

1.1.12 / 2014-05-19
===================
* package.json: require newer jslint module (>0.5.0)
* lib/jslint.js: delegate jslint file loading to jslint
* test/editions.js: use loadJSLint instead of ..fromPath
* test/jslin.js: use loadJSLint instead of ..fromPath
1.1.11 / 2014-05-08

@@ -2,0 +10,0 @@ ===================

23

lib/jslint.js

@@ -7,3 +7,5 @@

var path = require('path');
var resolve = path.resolve;
var nodelint = require('jslint/lib/nodelint');
var jslint = module.exports;

@@ -47,16 +49,2 @@

function loadJSLintFromPath(file, cb) {
var ctx = vm.createContext();
var f = fs.readFileSync(path.resolve(process.cwd(), file));
vm.runInContext(f, ctx);
JSLINT = jslint.JSLINT = ctx.JSLINT;
jslint.edition = JSLINT.edition;
if (cb) {
cb(null, jslint.edition);
}
}
/**

@@ -67,3 +55,2 @@ * Expose `loadJSLint`.

jslint.loadJSLint = loadJSLint;
jslint.loadJSLintFromPath = loadJSLintFromPath;

@@ -94,7 +81,3 @@ // default - can be overridden by setting 'edition' in grunt options

if (opts.edition) {
if (opts.edition.indexOf(".js") === opts.edition.length - 3) {
loadJSLintFromPath(opts.edition);
} else {
loadJSLint(opts.edition);
}
loadJSLint(opts.edition);
}

@@ -101,0 +84,0 @@

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

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

"dependencies": {
"jslint": ">=0.3.4"
"jslint": ">=0.5.0"
},

@@ -46,3 +46,5 @@ "devDependencies": {

"jscoverage": "~0.3.8",
"grunt-cli": "~0.1.13"
"grunt-cli": "~0.1.13",
"win-spawn": "~2.0.0",
"which": "~1.0.5"
},

@@ -49,0 +51,0 @@ "keywords": [

'use strict';
var spawn = require('child_process').spawn,
path = require('path'),
assert = require('better-assert');
var opts = {
cwd: path.join(__dirname, '..', '..', 'examples', 'all')
};
var out = '';
spawn('grunt', [ 'jslint' ], opts)
.on('close', function (code) {
// no errors
assert(code === 0);
// contains
assert(out.indexOf('Done, without errors.') !== -1);
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
if (process.argv.indexOf('--verbose') !== -1) {
process.stdout.write(data);
}
});
require('./runner')({
example: 'all',
errors: 0
});
'use strict';
require('./runner')({
example: 'client-server',
task: 'jslint:client',
errors: 1
});
var spawn = require('child_process').spawn,
path = require('path'),
assert = require('better-assert');
var opts = {
cwd: path.join(__dirname, '..', '..', 'examples', 'client-server')
};
function log(data) {
if (process.argv.indexOf('--verbose') !== -1) {
process.stdout.write(data);
}
}
var out = '';
// run client
spawn('grunt', [ 'jslint:client' ], opts)
.on('close', function (code) {
// has errors
// grunt seems to fail with random and
// arbitrary exit codes. `$ grunt jslint:client`
// fails with 3, but i have no idea why.
assert(code !== 0);
assert(out.indexOf('Missing \'use strict\' statement.') !== -1);
// contains
assert(out.indexOf('# JSLint failed, 1 violations in 1. 1 files scanned.') !== -1);
// run server
out = '';
spawn('grunt', [ 'jslint:server' ], opts)
.on('close', function (code) {
// has errors
// grunt seems to fail with random and
// arbitrary exit codes. `$ grunt jslint:client`
// fails with 3, but i have no idea why.
assert(code !== 0);
assert(out.indexOf('Unexpected sync method: \'readFileSync\'.') !== -1);
assert(out.indexOf('Unexpected dangling \'_\' in \'__dirname\'.') !== -1);
assert(out.indexOf('Missing \'use strict\' statement.') !== -1);
assert(out.indexOf('Unused \'req\'.') !== -1);
// contains
assert(out.indexOf('# JSLint failed, 4 violations in 1. 1 files scanned.') !== -1);
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
log(data);
});
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
log(data);
});
require('./runner')({
example: 'client-server',
task: 'jslint:server',
errors: 4
});
'use strict';
var spawn = require('child_process').spawn,
path = require('path'),
assert = require('better-assert');
var opts = {
cwd: path.join(__dirname, '..', '..', 'examples', 'deprecation')
};
var out = '';
spawn('grunt', [ 'jslint' ], opts)
.on('close', function (code) {
// no errors
assert(code !== 0);
// contains
assert(out.indexOf('grunt-jslint\'s interface has changed since 0.2.x') !== -1);
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
if (process.argv.indexOf('--verbose') !== -1) {
process.stdout.write(data);
}
});
require('./runner')({
example: 'deprecation',
errors: true,
message: 'grunt-jslint\'s interface has changed since 0.2.x'
});
'use strict';
var spawn = require('child_process').spawn;
var path = require('path');
var assert = require('better-assert');
var out = '';
var opts = {
cwd: path.join(__dirname, '..', '..', 'examples', 'exclude')
};
spawn('grunt', [ 'jslint' ], opts)
.on('close', function (code) {
// no errors
assert(code === 0);
// contains
assert(out.indexOf('Done, without errors.') !== -1);
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
if (process.argv.indexOf('--verbose') !== -1) {
process.stdout.write(data);
}
});
require('./runner')({
example: 'exclude',
errors: 0
});
'use strict';
var spawn = require('child_process').spawn,
path = require('path'),
assert = require('better-assert');
var opts = {
cwd: path.join(__dirname, '..', '..')
};
var out = '';
spawn('grunt', [ 'jslint' ], opts)
.on('close', function (code) {
// no errors
assert(code === 0);
// contains
assert(out.indexOf('Done, without errors.') !== -1);
})
.stdout.on('data', function (data) {
data = data.toString();
out += data;
if (process.argv.indexOf('--verbose') !== -1) {
process.stdout.write(data);
}
});
require('./runner')({
example: '..',
errors: 0
});

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

jslint.loadJSLintFromPath('node_modules/jslint/lib/jslint-2013-08-26.js', function () {
jslint.loadJSLint('node_modules/jslint/lib/jslint-2013-08-26.js', function () {
validate(file, opts, this.callback);

@@ -121,0 +121,0 @@ }.bind(this));

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

topic: function () {
jslint.loadJSLintFromPath('./node_modules/jslint/lib/jslint-latest.js', this.callback);
jslint.loadJSLint('./node_modules/jslint/lib/jslint-latest.js', this.callback);
},

@@ -108,0 +108,0 @@ 'should not error': function (err, report) {

Sorry, the diff of this file is not supported yet

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