Huge News!Announcing our $40M Series B led by Abstract Ventures.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.3 to 0.7.0

73

lib/cli.js
var fs = require('fs'),
path = require('path'),
argsparser = require('argsparser'),
cli = require('cli').enable('glob', 'help'),
hint = require('./hint');
var rootPath = path.resolve("/");
function existsSync() {

@@ -13,10 +11,2 @@ var obj = fs.existsSync ? fs : path;

function _help() {
process.stdout.write(fs.readFileSync(__dirname + "/../HELP", "utf-8"));
}
function _version() {
process.stdout.write(JSON.parse(fs.readFileSync(__dirname + "/../package.json", "utf-8")).version + "\n");
}
function _removeJsComments(str) {

@@ -45,3 +35,4 @@ str = str || '';

var filename = path.normalize(path.join(dir, name));
var filename = path.normalize(path.join(dir, name)),
parent = path.resolve(dir, "..");

@@ -52,4 +43,3 @@ if (existsSync(filename)) {

return dir === rootPath ?
null : _searchFile(name, path.normalize(path.join(dir, "..")));
return dir === parent ? null : _searchFile(name, parent);
}

@@ -94,43 +84,38 @@

interpret: function (args) {
var config, reporter,
options = argsparser.parse(args),
customConfig = options["--config"],
customReporter = options["--reporter"] ? path.resolve(process.cwd(), options["--reporter"]) : null,
targets = options.node,
extraExtensionList = options["--extra-ext"],
ignoreFile, ignores;
var config, reporter, options,
customConfig, customReporter,
ignoreFile, ignores, extraExtensionList;
//could be on Windows which we are looking for an attribute ending in 'node.exe'
if (targets === undefined) {
(function () {
var arg;
cli.setArgv(args);
cli.options = {};
options = cli.parse({
'version': ['v', 'display package version', 'boolean', false],
'config': ['config', 'custom config file', 'string', false],
'reporter': ['reporter', 'custom reporter', 'string', undefined],
'jslint-reporter': ['jslint-reporter', 'use a jslint compatible xml reporter'],
'show-non-errors': ['show-non-errors', 'show additional data generated by jshint'],
'extra-ext': ['extra-ext', 'comma-separated list of file extensions to use (.js is default)', 'string', '']
});
for (arg in options) {
if (path.basename(arg) === 'node.exe') {
targets = options[arg];
break;
}
}
}());
}
customConfig = options.config;
customReporter = options.reporter ? path.resolve(process.cwd(), options.reporter) : null;
extraExtensionList = options["extra-ext"];
targets = typeof targets === "string" ? null : targets.slice(1);
extraExtensionList = typeof extraExtensionList === "string" ? extraExtensionList : "";
if (options["--version"]) {
_version();
if (options.version) {
cli.setApp(path.resolve(__dirname + "/../package.json"));
process.stdout.write(cli.version + "\n");
return;
}
if (!targets || options["--help"]) {
_help();
if (options.help || !cli.args.length) {
cli.getUsage();
process.exit();
return;
}
if (options["--jslint-reporter"]) {
if (options['jslint-reporter']) {
customReporter = "./reporters/jslint_xml.js";
}
if (options["--show-non-errors"]) {
if (options['show-non-errors']) {
customReporter = "./reporters/non_error.js";

@@ -163,4 +148,4 @@ }

_print(hint.hint(targets, config, reporter, ignores, extraExtensionList));
_print(hint.hint(cli.args, config, reporter, ignores, extraExtensionList));
}
};
{
"name": "jshint",
"version": "0.6.3",
"version": "0.7.0",
"description": "A CLI for JSHint",

@@ -27,3 +27,3 @@ "homepage": "http://github.com/jshint/node-jshint",

"dependencies": {
"argsparser": "0.0.x",
"cli": "0.4.3",
"minimatch": "0.0.x"

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