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

babel-plugin-danger-remove-unused-import

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-danger-remove-unused-import - npm Package Compare versions

Comparing version 1.0.13 to 1.1.0

CHANGELOG.md

22

lib/index.js

@@ -51,13 +51,15 @@ 'use strict';

if (parentPath.isVariableDeclarator() && parentPath.get('id') === path) {}
// { Tabs: 'value' }
else if (parentPath.isLabeledStatement() && parentPath.get('label') === path) {}
// ref.ID
else if (parentPath.isMemberExpression() && parentPath.get('property') === path && parentPath.node.computed === false) {}
// class A { ID() {} }
else if ((parentPath.isClassProperty() || parentPath.isClassMethod()) && parentPath.get('key') === path) {} else {
// used
if (runtimeData[name]) {
delete runtimeData[name];
// const x = { Tabs: 'value' }
else if (parentPath.isObjectProperty() && parentPath.get('key') === path) {}
// { Tabs: 'value' }
else if (parentPath.isLabeledStatement() && parentPath.get('label') === path) {}
// ref.ID
else if (parentPath.isMemberExpression() && parentPath.get('property') === path && parentPath.node.computed === false) {}
// class A { ID() {} }
else if ((parentPath.isClassProperty() || parentPath.isClassMethod()) && parentPath.get('key') === path) {} else {
// used
if (runtimeData[name]) {
delete runtimeData[name];
}
}
}
}

@@ -64,0 +66,0 @@ };

{
"name": "babel-plugin-danger-remove-unused-import",
"version": "1.0.13",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "jest",
"clean": "rm -rf lib/*",
"babel": "babel src --out-dir lib -D",
"dev": "npm run babel -- -w",
"prepublish": "npm run clean; npm run babel"
"prepublish": "npm run clean; npm run babel",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"version": "npm run changelog"
},
"files": [
"lib"
"lib",
"index.js"
],
"keywords": [
"imcuttle",
"shake",
"remove-unused",

@@ -23,2 +28,6 @@ "babel-plugin"

"devDependencies": {
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"@moyuyc/husky": "^1.1.1",
"@types/jest": "^23.3.9",
"babel-cli": "^6.26.0",

@@ -31,3 +40,7 @@ "babel-core": "^6.26.0",

"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1"
"babel-preset-stage-0": "^6.24.1",
"conventional-changelog-cli": "^2.0.11",
"jest": "^23.6.0",
"prettier": "^1.14.3",
"pretty-quick": "^1.8.0"
},

@@ -46,3 +59,14 @@ "directories": {

},
"homepage": "https://github.com/imcuttle/babel-plugin-danger-remove-unused-import#readme"
"homepage": "https://github.com/imcuttle/babel-plugin-danger-remove-unused-import#readme",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
}
}
# babel-plugin-danger-remove-unused-import
[![Build status](https://img.shields.io/travis/imcuttle/babel-plugin-danger-remove-unused-import/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/babel-plugin-danger-remove-unused-import)
[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/babel-plugin-danger-remove-unused-import.svg?style=flat-square)](https://codecov.io/github/imcuttle/babel-plugin-danger-remove-unused-import?branch=master)
[![NPM version](https://img.shields.io/npm/v/babel-plugin-danger-remove-unused-import.svg?style=flat-square)](https://www.npmjs.com/package/babel-plugin-danger-remove-unused-import)
[![NPM Downloads](https://img.shields.io/npm/dm/babel-plugin-danger-remove-unused-import.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/babel-plugin-danger-remove-unused-import)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)
To shrink the bundle javascript size :smile:
For shrinking the bundled javascript size :smile:

@@ -10,2 +16,3 @@ **Note: remove unused import is dangerous**

## Option
```javascript

@@ -24,3 +31,3 @@ {

import moment from 'moment'
import {data} from '../some-where'
import { data } from '../some-where'

@@ -48,8 +55,4 @@ // ...

## ChangeLog
## Todo
- 1.0.9
Fix `<Comp.A/>` Bug
## Todo
1. Supporting Scope
- [ ] Supporting Scope
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