Remove unused imports.
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 (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;