In the grand scheme of things, writing code is easy. The challenge is writing clean code, to which there are many characteristics, from readability to conforming to best practices (e.g. principles such as SOLID).

One step you can take in writing cleaner code is using a linter, which is a tool that scans your code to ensure that it is free of syntactic and stylistic errors. Linters can potentially help you catch bugs before you even run tests against your code. Take them like a free second set of eyes – and yes, there are many free linters out there that you can use as a part of your workflow.

There are tools online that you can use, and certain text editors and IDEs that have some of this functionality built-in, but below are some editor-independent examples for some of the popular languages (and more) of today.

CSS: csslint
Docker: hadolint
HTML: HTMLHint
Javascript: eslint, jshint
JSON: jsonlint
PHP: phplint
Python: pycodestyle, pylint
Ruby: RuboCop
SCSS: scss-lint
Shell: ShellCheck
SQL: SQLint
XML: xmllint (part of libxml2)
YAML: yamllint