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

fez-jshint

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fez-jshint - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

package.json
{
"name": "fez-jshint",
"version": "0.1.0",
"version": "0.1.1",
"main": "src/main.js",
"dependencies": {
"bluebird": "~0.11.6-0",
"bluebird": "~1.0.3",
"jshint": "~2.4.1",

@@ -8,0 +8,0 @@ "ansi": "~0.2.1"

var Promise = require("bluebird"),
jshint = require("jshint").JSHINT,
JSHINT = require("jshint").JSHINT,
ansi = require("ansi"),

@@ -7,23 +7,32 @@ cursor = ansi(process.stdout);

module.exports = function(options) {
return function(inputs) {
return function jshint(inputs) {
return Promise.all(inputs.map(function(i) { return i.asBuffer(); })).then(function(buffers) {
var failed = false;
var failed = 0,
successful = 0;
if(buffers.length > 1) console.log("Linting...");
buffers.map(function(b) { return b.toString(); }).forEach(function(source, i) {
process.stdout.write("Linting " + inputs[i].getFilename() + "......");
if(!jshint(source, options)) {
failed = true;
if(buffers.length === 1) process.stdout.write("Linting " + inputs[i].getFilename() + "...... ");
if(!JSHINT(source, options)) {
failed += 1;
cursor.red();
console.log("FAIL");
cursor.reset();
jshint.errors.forEach(function(error) {
console.log(" " + error.reason + " (" + error.line + ":" + error.character + ")" );
JSHINT.errors.forEach(function(error) {
if(error)
console.log(" " + error.reason + " (" + error.line + ":" + error.character + ")" );
});
} else {
cursor.green();
console.log("OK");
cursor.reset();
if(buffers.length === 1) {
cursor.green();
console.log("OK");
cursor.reset();
}
successful += 1;
}
});
if(buffers.length > 1) console.log(successful + " passed. " + failed + " failed.");
if(failed) {
if(failed > 0) {
throw new Error();

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