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

mocha-jshint

Package Overview
Dependencies
Maintainers
7
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-jshint - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

35

git.js

@@ -6,2 +6,4 @@ var exec = require('child_process').exec;

var fs = require('fs');
var shjs = require("shelljs");
var minimatch = require("minimatch");

@@ -59,2 +61,17 @@ module.exports = function (options, cb) {

}
var jsHintIgnores = [];
try {
jsHintIgnores = fs.readFileSync(path.resolve('.jshintignore'), 'utf-8')
.split('\n')
.filter(function (line) {
return !!line.trim();
})
.map(function (line) {
if (line[0] === "!") {
return "!" + path.resolve(line.substr(1).trim());
}
return path.resolve(line.trim());
});
} catch (ex) {
}
var files = uniq(stdout.split('\n'))

@@ -65,6 +82,24 @@ .filter(function (filename) {

.filter(function (filename) {
return !isIgnored(filename, jsHintIgnores);
})
.filter(function (filename) {
return fs.existsSync(path.resolve(filename));
});
return cb(null, files);
function isIgnored(fp, patterns) {
return patterns.some(function (ip) {
if (minimatch(path.resolve(fp), ip, {nocase: true})) {
return true;
}
if (path.resolve(fp) === ip) {
return true;
}
if (shjs.test("-d", fp) && ip.match(/^[^\/]*\/?$/) &&
fp.match(new RegExp("^" + ip + ".*"))) {
return true;
}
});
}
}
};

6

package.json
{
"name": "mocha-jshint",
"version": "2.2.2",
"version": "2.2.3",
"description": "run JSHint as mocha tests",

@@ -19,3 +19,5 @@ "main": "index.js",

"dependencies": {
"jshint": "^2.7",
"jshint": "~2.7.0",
"minimatch": "^2.0.7",
"shelljs": "^0.4.0",
"uniq": "^1.0.1"

@@ -22,0 +24,0 @@ },

@@ -59,3 +59,3 @@ mocha-jshint [![npm version](https://badge.fury.io/js/mocha-jshint.svg)](http://badge.fury.io/js/mocha-jshint) [![Build Status](https://travis-ci.org/ebdrup/mocha-jshint.svg?branch=master)](https://travis-ci.org/ebdrup/mocha-jshint) [![Dependency Status](https://david-dm.org/ebdrup/mocha-jshint.svg)](https://david-dm.org/ebdrup/mocha-jshint) [![devDependency Status](https://david-dm.org/ebdrup/mocha-jshint/dev-status.svg)](https://david-dm.org/ebdrup/mocha-jshint#info=devDependencies)

----------------
Normally I would recommend configuring what to lint with `.jshintingore` described in
Normally I would recommend configuring what to lint with `.jshintignore` described in
[configuring jshint](https://github.com/ebdrup/mocha-jshint#configuring-jshint).

@@ -62,0 +62,0 @@ And just lint the working directory.

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