You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linter: Introduce version gated linter rules (#1453)
This pull request introduces version-gated linter rule filtering so that
upgrading Herb doesn't unexpectedly enable new rules for users who have
locked their `.herb.yml` version.
Each rule now declares `static introducedIn = this.version("X.Y.Z")`
indicating the version it was first released in. When a user's
`.herb.yml` version is older than a rule's `introducedIn`, that rule is
automatically skipped. Users can still explicitly enable any rule in
their config regardless of version
**No `.herb.yml`**
<img width="2093" height="623" alt="CleanShot 2026-03-22 at 04 54 37@2x"
src="https://github.com/user-attachments/assets/9449b98d-ace2-4446-a3d4-36d9ffc275ab"
/>
**`.herb.yml` with older version**
<img width="1942" height="2022" alt="CleanShot 2026-03-22 at 04 55
27@2x"
src="https://github.com/user-attachments/assets/95315081-693d-4614-963e-de57428544b5"
/>
**Running `--upgrade`**
<img width="1928" height="1748" alt="CleanShot 2026-03-22 at 04 59
31@2x"
src="https://github.com/user-attachments/assets/245a6ac3-3c3e-4757-aee8-3c938e0da80b"
/>
"check:rule-versions": "! grep -rl 'static introducedIn = \"unreleased\"' src/rules/ 2>/dev/null || (echo '\\n✗ Found linter rules with introducedIn = \"unreleased\". Update them to a release version before publishing.\\n' && exit 1)",
console.log(`\n${colorize("✓","brightGreen")} Updated ${colorize(".herb.yml","cyan")} version from ${colorize(configVersion,"cyan")} to ${colorize(version,"cyan")}`)
console.log(` ${colorize("TIP:","bold")} Run ${colorize("herb-lint --init","cyan")} to create a ${colorize(".herb.yml","cyan")} and lock the ${colorize("version","cyan")}.`)
322
+
console.log(` This ensures upgrading Herb won't enable new rules until you update the ${colorize("version","cyan")} in ${colorize(".herb.yml","cyan")}.`)
0 commit comments