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 2.1.8 to 2.1.9

8

package.json
{
"name": "jshint",
"version": "2.1.8",
"version": "2.1.9",
"homepage": "http://jshint.com/",

@@ -27,5 +27,5 @@ "description": "Static analysis tool for JavaScript",

"scripts": {
"build": "node ./make.js build",
"test": "node ./make.js test",
"lint": "node ./make.js lint"
"build": "node make.js build",
"test": "nodeunit tests tests/stable/regression tests/stable/unit",
"pretest": "jshint --config=jshint.json src"
},

@@ -32,0 +32,0 @@

@@ -78,20 +78,16 @@ "use strict";

*
* @param {sting} file path to the file to be linted
* @param {string} file path to the file to be linted
* @returns {string} a path to the config file
*/
function findConfig(file) {
var name = ".jshintrc";
var dir = path.dirname(path.resolve(file));
var proj = findFile(name, dir);
var home = path.normalize(path.join(process.env.HOME ||
process.env.HOMEPATH ||
process.env.USERPROFILE, name));
var dir = path.dirname(path.resolve(file));
var envs = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
var home = path.normalize(path.join(envs, ".jshintrc"));
if (proj) {
var proj = findFile(".jshintrc", dir);
if (proj)
return proj;
}
if (shjs.test("-e", home)) {
if (shjs.test("-e", home))
return home;
}

@@ -102,2 +98,20 @@ return null;

/**
* Tries to find JSHint configuration within a package.json file
* (if any). It search in the current directory and then goes up
* all the way to the root just like findFile.
*
* @param {string} file path to the file to be linted
* @returns {object} config object
*/
function loadNpmConfig(file) {
var dir = path.dirname(path.resolve(file));
var fp = findFile("package.json", dir);
if (!fp)
return null;
return require(fp).jshintConfig || null;
}
/**
* Tries to import a reporter file and returns its reference.

@@ -379,3 +393,3 @@ *

files.forEach(function (file) {
var config = opts.config || exports.loadConfig(findConfig(file));
var config = opts.config || loadNpmConfig(file) || exports.loadConfig(findConfig(file));
var code;

@@ -382,0 +396,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