TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Linters for excellent code?

2 pointsby residualmindover 4 years ago
We all know our linters and their benefits. They encourage or enforce a certain level of quality in our code. Most of the time, they cannot ensure that we use the best method to achieve our goals.<p>If you enable warnings for metrics like cyclomatic complexity, a maximum number of lines in a function, or duplicate code, your linter will indirectly force you to refactor an ugly spaghetti mess into something that usually is a lot better. Or when writing new code at some point you will get a warning that shows you you have reached a point where you need to break up a method or abstract something.<p>So, a linter will not only help you prettify your code superficially but can actually help you make it a lot better. But usually the goal is to reach a certain level of quality - when you have no more warnings or style suggestions, and that&#x27;s it. The limits in default linter settings are usually meant to avoid really bad code and to encourage good code. But from my experience that is where it stops - they do not encourage <i>excellent</i> code.<p>TL;DR<p>I was wondering, does anyone use special linters or settings that are, for instance, much more restrictive or smart than what is normally used, in order to not only achieve good, readable code, but to go beyond that and help or force you to write even better, excellent code?

1 comment

mtmailover 4 years ago
We use additional linters that check for security best practices like <a href="https:&#x2F;&#x2F;brakemanscanner.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;brakemanscanner.org&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;djezzzl&#x2F;database_consistency" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;djezzzl&#x2F;database_consistency</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;ankane&#x2F;strong_migrations" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ankane&#x2F;strong_migrations</a>