Replies: 1 comment
-
It is not possible now doing it in YAML now since it requires mapping a multi-variable match to multiple terms. You can do it using napi instead. https://ast-grep.github.io/guide/api-usage.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, if I want to match:
and rewrite to:
How should I do it? If I use
import { $$$LODASH_PKGS } from 'lodash'
as the pattern andimport $$$LODASH_PKGS from 'lodash/$$$LODASH_PKGS'
as the fix, end end result will becomeimport merge, omit from 'lodash/merge, omit'
, which is invalid syntaxBeta Was this translation helpful? Give feedback.
All reactions