Skip to content

chore: replace deprecated sg command with ast-grep - #18

Merged
SynthLuvr merged 1 commit into
mainfrom
chore/use-ast-grep-cli
Aug 2, 2026
Merged

SynthLuvr merged 1 commit into
mainfrom
chore/use-ast-grep-cli

Conversation

@SynthLuvr

Copy link
Copy Markdown
Owner

Summary

The sg CLI binary (shipped by @ast-grep/cli) is deprecated as of v0.45.0. Running it now prints a deprecation warning:

========================================================================
WARNING: `sg` is deprecated. Use `ast-grep` instead.
========================================================================

This replaces all four pnpm exec sg scan ... invocations in package.json with pnpm exec ast-grep scan ...:

  • strip-braces
  • lint:exports
  • lint:functions
  • lint:file-comment

Investigation

  • Confirmed sg and ast-grep are both binaries provided by @ast-grep/cli (already at ^0.45.0 in package.json/lockfile).
  • Running pnpm exec sg --version against v0.45.0 emits the deprecation warning shown above, whereas ast-grep does not.
  • Verified sg is only referenced as a command in these four scripts (no sgconfig.yml or docs references).

Verification

pnpm build   # exit 0 (tsc)
pnpm lint    # exit 0 (biome, oxlint, ast-grep scans, md, peer-deps)
pnpm test    # 3 passed

All three pass with zero errors, and the deprecation warning is gone.

The `sg` CLI binary shipped by @ast-grep/cli is deprecated as of
v0.45.0. Running it now prints:

  WARNING: `sg` is deprecated. Use `ast-grep` instead.

Replace all four `pnpm exec sg scan ...` invocations in package.json
(strip-braces, lint:exports, lint:functions, lint:file-comment) with
`pnpm exec ast-grep scan ...`.

Verified: build, lint, and test all pass with zero errors and the
deprecation warning is gone.
@SynthLuvr
SynthLuvr merged commit 5e65baf into main Aug 2, 2026
1 check passed
@SynthLuvr
SynthLuvr deleted the chore/use-ast-grep-cli branch August 2, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant