{"analyzedAt":"2022-07-09T16:24:18.065Z","collected":{"metadata":{"name":"grunt-import-clean","scope":"unscoped","version":"0.1.10","description":"identify unused imports in es6 modules","keywords":["gruntplugin","es6","module","transpiler","clean"],"date":"2015-12-07T00:26:56.078Z","author":{"name":"Bernard McManus","email":"bernard.mcmanus.iv@gmail.com","url":"https://github.com/elnarddogg","username":"elnarddogg"},"publisher":{"username":"elnarddogg","email":"bernard.mcmanus.iv@gmail.com"},"maintainers":[{"username":"elnarddogg","email":"bernard.mcmanus.iv@gmail.com"}],"repository":{"type":"git","url":"git://github.com/elnarddogg/grunt-import-clean.git"},"links":{"npm":"https://www.npmjs.com/package/grunt-import-clean"},"license":"MIT","dependencies":{"fs-extra":">=0.9.1","colors":">=1.0.3"},"devDependencies":{"grunt-contrib-jshint":"^0.9.2","grunt-contrib-clean":"^0.5.0","grunt-contrib-nodeunit":"^0.3.3","grunt":"~0.4.5"},"peerDependencies":{"grunt":"~0.4.5"},"releases":[{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2020-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1}],"readme":"# grunt-import-clean\n\n> Identify unused imports in ES6 modules.\n\n## Overview\n\n`grunt-import-clean` is a simple plugin that identifies imports that are never referenced in modules utilizing the new ES6 syntax:\n\n```javascript\nimport {\n  $_is,\n  $_slice,\n  $_shift,\n  $_pop,\n  $_forEach,\n  $_length\n} from 'static/shared';\n\nexport default function Constructor() {\n  // ...\n}\n\nConstructor.prototype = {\n  // ...\n};\n```\n\n## Getting Started\nThis plugin requires Grunt `~0.4.5`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-import-clean --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```javascript\ngrunt.loadNpmTasks( 'grunt-import-clean' );\n```\n\n## The import-clean task\n\n### Overview\nIn your project's Gruntfile, add a section named `'import-clean'` to the data object passed into `grunt.initConfig()`.\n\n```javascript\ngrunt.initConfig({\n  'import-clean': {\n  target: [ /* target-specific file paths or patters go here. */ ],\n  },\n});\n```\n\n### Options\n\n| Property | Type                  | Default | Description |\n| -------- | --------------------- | ------- | ----------- |\n| `force` | `Boolean` | `false` | A boolean value indicating whether grunt should continue if unused imports are detected. |\n| `ignore` | `String` or `Array of String` | `[]` | The name(s) of unused imports to ignore. If ignored unused imports are detected, they will still be reported on with a warning. If *only* ignored unused imports are detected, grunt will continue. |\n| `test` | `Boolean` | `false` | A boolean value indicating whether unit tests should be run. |\n\n### Usage Examples\n\nIn this example, `'import-clean:all'` validates imports in all source files, while `'import-clean:some'` validates only specific files.\n\n#### Configuration\n\n```javascript\ngrunt.initConfig({\n  'import-clean': {\n  all: 'src/*.js',\n  some: [ 'src/controller.js' , 'src/service.js' ]\n  },\n});\n```\n\n#### Output\n\n```shell\n# success\n\nValidating imports in 5 files... ✓ OK\n```\n\n```shell\n# error\n\nValidating imports in 5 files...\n\n\"controller.js\": [\n  \"$_is\",\n  \"$_forEach\"\n],\n\"service.js\": [\n  \"$_isArray\"\n]\n\nWarning: found 3 unused imports in 2 files. Use --force to continue.\n```\n\n\n#### Configuration with `ignore` option\n\n```javascript\ngrunt.initConfig({\n  'import-clean': {\n    all: 'src/*.js',\n    some: [ 'src/Component.jsx' , 'src/service.js' ],\n    options: {\n      ignore: ['React']  // OR simply ignore: 'React', OR to ignore multiple imports ['React', 'SomethingElse']\n    }\n  },\n});\n```\n\n#### Output with `ignore` option\n\n```shell\n# success (only ignored unused imports found, grunt continues)\n\nValidating imports in 5 files...\n\n\"Component.jsx\": [\n  \"React   (IGNORED)\"\n]\n\nWarning: found 1 unused imports in 1 files (1 IGNORED). Use --force to continue.\n```\n\n```shell\n# error (ignored and non-ignored unused imports found, grunt stops)\n\nValidating imports in 5 files...\n\n\"Component.jsx\": [\n  \"React   (IGNORED)\",\n  \"$_forEach\"\n],\n\"service.js\": [\n  \"$_isArray\"\n]\n\nWarning: found 3 unused imports in 2 files (1 IGNORED). Use --force to continue.\n```"},"npm":{"downloads":[{"from":"2022-07-08T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":2},{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":32},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":151},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":214},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":396}],"starsCount":0},"github":{"starsCount":1,"forksCount":2,"subscribersCount":2,"issues":{"count":6,"openCount":4,"distribution":{"3600":1,"10800":1,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":4},"isDisabled":false},"contributors":[{"username":"bernardmcmanus","commitsCount":14},{"username":"davnicwil","commitsCount":3}],"commits":[{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":3426,"testsSize":16125}}},"evaluation":{"quality":{"carefulness":0.355,"tests":0.3,"health":0.3333333333333333,"branding":0},"popularity":{"communityInterest":7,"downloadsCount":50.333333333333336,"downloadsAcceleration":0.021423135464231358,"dependentsCount":0},"maintenance":{"releasesFrequency":0.7591609589041095,"commitsFrequency":0,"openIssues":0.33333333333333337,"issuesDistribution":0}},"score":{"final":0.34201734311980586,"detail":{"quality":0.5468804497405205,"popularity":0.03969986756306342,"maintenance":0.4687378701445072}}}