babel-plugin-danger-remove-unused-import
Version:
[](https://travis-ci.org/imcuttle/babel-plugin-danger-remove-unused-import) [ • 1.8 kB
Markdown
[](https://travis-ci.org/imcuttle/babel-plugin-danger-remove-unused-import)
[](https://codecov.io/github/imcuttle/babel-plugin-danger-remove-unused-import?branch=master)
[](https://www.npmjs.com/package/babel-plugin-danger-remove-unused-import)
[](https://www.npmjs.com/package/babel-plugin-danger-remove-unused-import)
[](https://prettier.io/)
[](https://conventionalcommits.org)
For shrinking the bundled javascript size :smile:
**Note: remove unused import is dangerous**
**because the imported package may have some side effects!**
```javascript
{
ignore: ['react']
}
```
```javascript
import React from 'react'
import Button from 'button'
import _ from 'lodash'
import moment from 'moment'
import { data } from '../some-where'
// ...
const a = {}
a.moment = <Button x={data} />
```
```diff
import React from 'react'
import Button from 'button'
- import _ from 'lodash'
- import moment from 'moment'
import {data} from '../some-where'
// ...
const a = {}
a.moment = <Button x={data} />
```
- [ ] Supporting Scope