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/git


Keywords
imcuttle, shake, remove-unused, babel-plugin, babel, remove-unused-import
License
MIT
Install
npm install babel-plugin-danger-remove-unused-import@1.0.0

Documentation

babel-plugin-danger-remove-unused-import

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

For shrinking the bundled javascript size 😄

Note: remove unused import is dangerous because the imported package may have some side effects!

Option

{
  ignore: ['react']
}

Input

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} />

Output

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} />

Todo

  • Supporting Scope