Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.76 KB

File metadata and controls

55 lines (40 loc) · 1.76 KB

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