--depth 1 --single-branch
. You can specify branch
to clone specific (not default branch).
If you want to disable shallow clone, you can provide it with extended configuration.addImport
and removeImport
to add or remove imports, astGrep
to search for code patterns and jscodeshift
to transform code.jsFam
is always should be used together with files command. It automatically adds glob to find all js/ts files, so calling files().jsFam()
is equivalent to files('**/*.{js,jsx,ts,tsx,cjs,mjs}').jsFam()
.Callback helpers:addImport(imports)
- Accepts code with imports and automatically merges file imports with provided imports.removeImport(imports)
- Accepts code with imports and automatically removes provided imports from file imports.console.log($$$A)
; by default relaxed
strictness algorithm is used, meaning that comments and non-significant syntax constructs (like single and double quotes for JavaScript) will be ignored.ast-grep
engine.NapiConfig
object, so you can copy rules from ast-grep playground and paste them here.AstGrepAPI
. In this case request is sent to ast-grep
CLI and you can use all its features, like fix
. But there is no programmatic access to the results, it is one-way operation. It has similar syntax to NapiConfig
, but with additional id
field.import { useEffect } from "react"
.import { useEffect } from "react"
.