babel-plugin-danger-remove-unused-import

v2.0.0
[![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
imcuttle shake remove-unused babel-plugin

babel-plugin-danger-remove-unused-import

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

For shrinking the bundled javascript size :smile:

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
npm i babel-plugin-danger-remove-unused-import

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 9/9/2019

Downloads

Maintainers