Herrington Darkholme
hd-nvim.bsky.social
Herrington Darkholme
@hd-nvim.bsky.social
#ast_grep_trick ast-grep's rule is heavily inspired by CSS selectors. The rule `identifier` node is `inside` the node `call_expression` is something similar to `call_expression > identifier`
July 28, 2025 at 3:19 AM
letting AI write an ast-grep rule for me.
I'm using cursor, ast-grep mcp tool, custom cursor rule and gemini-2.5pro
June 19, 2025 at 6:15 PM
ast-grep rule cheat sheet
June 15, 2025 at 1:58 PM
Compare biomejs plugin with ast-grep in one picture: both syntax and speed.
June 4, 2025 at 4:29 PM
One pic to compare ast-grep rule syntax with biome plugin syntax.

The example shows the rule no-implicit-bool-jsx-attr,
e.g. <div draggable /> => <div draggable={true} />
May 29, 2025 at 2:03 PM
A proof of concept to run ast-grep via OXC parser
May 4, 2025 at 9:36 PM
May 4, 2025 at 5:33 PM
ast-grep playground now shows the wasm parser version it is using. convenient to debug parser version difference from CLI
February 16, 2025 at 6:28 AM
Learning a tool can be overwhelming, but ast-grep's new UI makes it easier to explore bit by bit.
📊 Better visuals: Show more rule information
🔍 Filter examples: By rules, features, and languages
📈 Sort by complexity: Start with easy rules and explore sophisticated ones
February 13, 2025 at 7:49 PM
February 12, 2025 at 5:04 AM
February 10, 2025 at 3:21 PM
my hand-rolled code is better than AI i guess
February 9, 2025 at 3:53 AM
January 30, 2025 at 8:54 PM
ast-grep now has HTML rule example! BTW you can also use it with Vue, Svelte or Astro!
January 20, 2025 at 7:40 PM
Hey LLM, please read this step-by-step breakdown of ast-grep rule.
January 20, 2025 at 6:27 AM
New ast-grep example for C++!
January 19, 2025 at 4:08 PM
TIL civetlang, typed coffee-script, supports if/else in type
January 8, 2025 at 6:07 AM
ast-grep's LSP now can report unused directive and remove them!
December 29, 2024 at 8:28 PM
typed ast-grep rule in TypeScript
December 18, 2024 at 4:20 AM
TypeScript Puzzle!
December 16, 2024 at 5:12 PM
December 16, 2024 at 5:14 AM
Can switching colorscheme when editing Nextjs files helps telling if it is client or server component?
github.com/HerringtonDa...
December 11, 2024 at 1:02 AM
New ast-grep feature! You can now use `range` to select AST nodes in the source code.

Why will it be useful? Find nodes using sources like Rust Analyzer, TypeScript, and other language tools!
e.g. Use tsc to find errors and tell ast-grep to fix them!
December 4, 2024 at 5:54 AM
Pro tip: You can combine three ast-grep flags: `--stdin` , `--inline-rules`, and `--json`, to use the tool programmatically without API!

The image is an example of using bash to invoke ast-grep.
December 3, 2024 at 4:34 PM
New ast-grep perf improvement for multi-language projects! Previously the CLI scans all files even if a file has no matching rule. Now it is will only scan candidate files which can produce lint errors.
In Next.js, where sg lints only Rust, the trick improves linting time by 90%
December 2, 2024 at 3:30 AM