babel-plugin-danger-remove-unused-import
Advanced tools
Comparing version 1.0.13 to 1.1.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
14627
9
263
0
56
16