5 ms·
One of the things i miss the most from developing in ruby is the code quality instrumentation: metric-fu, reek, rubocop and lots of other gems that allowed us (
by xtracto 2y ago
One of the things i miss the most from developing in ruby is the code quality instrumentation: metric-fu, reek, rubocop and lots of other gems that allowed us (in a previous ruby shop) understand and monitor the quality of our code like ABC, Cyclomatic complexity, duplicated code, etc).
Now in Typescript, I haven't found a lot of tools to calculate,visualize and track these stats. Metric-fu was amazing.
- Alifatisk 2y agoDon't forget about Brakeman!
- MrJohz 2y agoYou can get a lot of mileage out of ESLint + typescript-ESLint + various other plugins. It's more of a "choose your own adventure" kind of experience, but the defaults are a good start, and if you're looking for cyclomatic complexity and all that jazz, there's various plugins that can calculate that. And the typescript ESLint plugin is great because it uses the types as part of the hints, which is great for finding places where you no longer need optional chaining, or where a condition is always true/false because you forgot what types things were. That said, I tend to take a much more lean approach to linting these days. I try to only include lints that are actionable, likely to lead to real bugs, and have no false positives. Everything else feels like it's better handled in code review. If you don't know why your function is too complex and difficult to read, I don't want you to rewrite it just to satisfy a robot that's following arbitrary rules! I want to be able to have a discussion with you about proper techniques for splitting apart code. But there's definitely people who go the other way entirely and build incredibly strict ESLint configurations, so looking for those might help you if that's what you want.
- erulabs 2y agoI wonder if anyone here has a good set of Typescript/ESlint addons to suggest? I also miss my duplicate code alert from Ruby!
- emmanueloga_ 2y agoI'm pretty happy with Biome's defaults [1]. From time to time, I disable some rules that are too restrictive (like "noExplicitAny", which I turn into info instead of an error). -- 1: https://biomejs.dev/linter/ https://biomejs.dev/linter/
- burnt-resistor 2y ago[flagged]
- deciduously 2y agoOr "person with a job"...?