New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jshint

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jshint - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

5

lib/cli.js

@@ -96,2 +96,3 @@ var fs = require('fs'),

targets = options.node,
extraExtensionList = options["--extra-ext"],
ignoreFile, ignores;

@@ -115,2 +116,4 @@

extraExtensionList = typeof extraExtensionList === "string" ? extraExtensionList : "";
if (options["--version"]) {

@@ -158,4 +161,4 @@ _version();

_print(hint.hint(targets, config, reporter, ignores));
_print(hint.hint(targets, config, reporter, ignores, extraExtensionList));
}
};

17

lib/hint.js

@@ -73,12 +73,11 @@ var fs = require('fs'),

function _collect(filePath, files, ignore) {
function _collect(filePath, files, ignore, regExtension) {
if (ignore && _shouldIgnore(filePath, ignore)) {
return;
}
if (fs.statSync(filePath).isDirectory()) {
fs.readdirSync(filePath).forEach(function (item) {
_collect(path.join(filePath, item), files, ignore);
_collect(path.join(filePath, item), files, ignore, regExtension);
});
} else if (filePath.match(/\.js$/)) {
} else if (filePath.match(regExtension)) {
files.push(filePath);

@@ -89,9 +88,13 @@ }

module.exports = {
hint: function (targets, config, reporter, ignore) {
hint: function (targets, config, reporter, ignore, extraExtensionList) {
var files = [],
results = [],
data = [];
data = [],
regExtension;
extraExtensionList = extraExtensionList || "";
regExtension = new RegExp('\\.(js' + (extraExtensionList === "" ? "" : "|" + extraExtensionList.replace(/,/g, "|").replace(/[\. ]/g, "")) + ")$");
targets.forEach(function (target) {
_collect(target, files, ignore);
_collect(target, files, ignore, regExtension);
});

@@ -98,0 +101,0 @@

{
"name": "jshint",
"version": "0.6.1",
"version": "0.6.2",
"description": "A CLI for JSHint",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/jshint/node-jshint",

@@ -63,2 +63,8 @@ # node-jshint

## File Extensions
Default extension for files is ".js". If you want to use JSHint with other file extensions (.json), you need to pass this extra extension as an option :
--extra-ext .json
## Ignoring Files and Directories

@@ -65,0 +71,0 @@

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