Bonsai-lint – A multi-language cognitive complexity linter
ryckakas · 1 points · 1 comments · 5 jam yang lalu · Open original
Comments
1 preview comments · loading full thread
Log in to use comments
Log in to h4cker, then connect Hacker News to publish comments.
RYryckakas5 jam yang lalu
I work across several languages in the same monorepo and couldn't find a linter that scored cognitive complexity consistently across all of them. I also needed full support for Vue.js SFCs, which most linters ignore.
I wrote bonsai-lint to fix this. It's a single Rust binary that parses your code (never executes it) to calculate a unified complexity score across Go, Java, Python, PHP, JS/TS, and Vue SFCs.
It's proven especially useful when paired with AI agents. Having a strict complexity target enabled me to prompt AI agents to refactor bloated, messy functions into much cleaner, readable ones.
Browser Playground: https://bonsai.kauneckas.dev/play/
GitHub: https://github.com/ryckakas/bonsai-lint
I'd love to hear your feedback, especially if you spot any scores that feel inaccurate.
Comments
1 preview comments · loading full threadLog in to h4cker, then connect Hacker News to publish comments.
I work across several languages in the same monorepo and couldn't find a linter that scored cognitive complexity consistently across all of them. I also needed full support for Vue.js SFCs, which most linters ignore. I wrote bonsai-lint to fix this. It's a single Rust binary that parses your code (never executes it) to calculate a unified complexity score across Go, Java, Python, PHP, JS/TS, and Vue SFCs. It's proven especially useful when paired with AI agents. Having a strict complexity target enabled me to prompt AI agents to refactor bloated, messy functions into much cleaner, readable ones. Browser Playground: https://bonsai.kauneckas.dev/play/ GitHub: https://github.com/ryckakas/bonsai-lint I'd love to hear your feedback, especially if you spot any scores that feel inaccurate.