https://github.com/imcuttle/babel-plugin-danger-remove-unused-import
babel-plugin-danger-remove-unused-import
https://github.com/imcuttle/babel-plugin-danger-remove-unused-import
babel remove-unused-import
Last synced: 3 months ago
JSON representation
babel-plugin-danger-remove-unused-import
- Host: GitHub
- URL: https://github.com/imcuttle/babel-plugin-danger-remove-unused-import
- Owner: imcuttle
- License: mit
- Created: 2017-11-29T12:50:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T04:36:13.000Z (over 2 years ago)
- Last Synced: 2025-03-23T02:33:59.074Z (4 months ago)
- Topics: babel, remove-unused-import
- Language: JavaScript
- Size: 1.57 MB
- Stars: 19
- Watchers: 1
- Forks: 6
- Open Issues: 17
-
Metadata Files:
- Readme: Readme.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
# babel-plugin-danger-remove-unused-import
[](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!**## Option
```javascript
{
ignore: ['react']
}
```## Input
```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 =
```## Output
```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 =
```## Todo
- [x] Supporting Scope