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

grunt-import-clean

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-import-clean - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "grunt-import-clean",
"description": "identify unused imports in es6 modules",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/elnarddogg/grunt-import-clean",

@@ -6,0 +6,0 @@ "author": {

@@ -25,5 +25,4 @@ module.exports = function( grunt ) {

var testAdaptor = options.test ? new TestAdaptor( __dirname ) : testAdaptor;
var force = options.force !== undefined ? options.force : true;
grunt.option( 'force' , options.force !== undefined ? options.force : true );
var files = data.reduce(function( prev , current ) {

@@ -59,14 +58,25 @@ return prev.concat(

var result = aggregate( files );
var msg;
if (options.test) {
testAdaptor.write( that.target , result );
util.puts( ('\ntest output written to tmp/' + that.target + '.json').yellow );
msg = '\ntest output written to tmp/' + that.target + '.json';
util.puts( msg.yellow );
}
else if (result.foundFiles) {
print( result.unused );
grunt.fail.warn(
'found ' + result.foundImports +
msg = 'found ' + result.foundImports +
' unused imports in ' + result.foundFiles +
' file' + (result.foundFiles > 1 ? 's' : '') + '.'
);
' file' + (result.foundFiles > 1 ? 's' : '') + '.';
// grunt.option( 'force' , true ) will force all subsequent tasks.
// this handles the force option politely.
if (force) {
util.puts(( 'Warning: ' + msg ).yellow );
}
else {
grunt.fail.warn( msg );
}
}

@@ -73,0 +83,0 @@ else {

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