Skip to content

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

Merged
SynthLuvr merged 1 commit into
mainfrom
chore/replace-deprecated-sg-with-ast-grep
Aug 2, 2026
Merged

SynthLuvr merged 1 commit into
mainfrom
chore/replace-deprecated-sg-with-ast-grep

Conversation

@SynthLuvr

Copy link
Copy Markdown
Owner

Summary

Replace 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

The sg CLI binary (shipped by @ast-grep/cli) is deprecated as of
v0.45.0
and prints a warning when run:

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

This project is currently on @ast-grep/cli@^0.44.1, so the warning
does not fire yet. However, the ast-grep binary is already available
and is a drop-in replacement, so this change is forward-compatible — it
keeps the project aligned with the upstream template and avoids the
deprecation warning once the dependency is bumped to >=0.45.0.

Backport of SynthLuvr/typescript-template#18.

Verification

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

All three pass with zero errors.

The sg CLI binary shipped by @ast-grep/cli is deprecated as of
v0.45.0. Running it 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.

Backport of SynthLuvr/typescript-template#18.
@SynthLuvr
SynthLuvr merged commit c6822c1 into main Aug 2, 2026
2 checks passed
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