Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 978 Bytes

File metadata and controls

52 lines (37 loc) · 978 Bytes

unused-imports

Remove unused imports.

Usage

npx lil-codemods unused-imports path/of/files/ or/some**/*glob.js

# or

yarn global add lil-codemods
lil-codemods unused-imports path/of/files/ or/some**/*glob.js

Input / Output


basic

Input (basic.input.js):

import {
  JSCodeshift,
  ObjectProperty,
  ObjectMethod,
  File,
  ASTPath,
  ImportDeclaration
} from "jscodeshift";

import { ASTNode } from "jscodeshift";
import { ASTNode as ASTNode2 } from "jscodeshift";
import { Mappings } from "jscodeshift";

const a = JSCodeshift;

Output (basic.output.js):

import { JSCodeshift } from "jscodeshift";

const a = JSCodeshift;