Skip to content

v0.1.8 — Lint explainers, typo correction, friendlier toggle help

Choose a tag to compare

@Juliocbm Juliocbm released this 24 May 03:17

Three UX improvements that make the CLI more discoverable when you don't quite remember the right name or rule.

✨ New

  • beacon lint --explain <rule> — verbose docs for any of the 11 lint rules: severity, why the rule exists, allowed patterns, example violations (bad → good), and how to fix.

    beacon lint --explain                  # list all rules grouped by severity
    beacon lint --explain kebab-case       # explain a specific rule
  • Typo correction for unknown commands and add-ons — Levenshtein-based "did you mean?" suggestions (max 3 edits).

    $ beacon linnt
    ✗ Error: Unknown command "linnt".
      → Did you mean lint?
    
    $ beacon enable opperations
    ✗ Error: Unknown add-on category: "opperations". Did you mean "operations"?
  • beacon enable / beacon disable with no add-on — now print the list of available add-on categories with one-line descriptions instead of cac's terse missing required arg error.

🧰 Internal

  • New module src/ui/suggest.ts (classic Levenshtein DP + closestMatch helper) reused by both the lint --explain typo handler and the enable/disable validator.
  • 13 new unit tests for suggest.ts. Test suite now at 180 passing across 30 files.

Install / upgrade

npm install -g beacon-docs@0.1.8
# or one-off:
npx beacon-docs@latest lint --explain

Full changelog: https://github.com/Juliocbm/beacon-docs/blob/main/CHANGELOG.md