Linters
Learn and practice linters, specifically Elixir's main linter-Credo, in this lesson.
We'll cover the following...
Credo: linter as teacher
Linters are important because they automate tedious style and code quality checks. Linter rules don’t exist in a vacuum. The coding rules come from the language community. As the language evolves, so does the linter. One of the most useful libraries for code consistency is René Föhring’s Credo. It’s a linter like Ruby’s Rubocop or JSLint for JavaScript, but as it proclaims in the tagline on GitHub, it’s a linter “with a focus on code consistency and teaching.” That aim is what makes Credo so interesting.
With a standard linter, you might get some warning or suggestion, and instead of understanding the issue, you make the change and move on. The linter helps improve the quality of the code, but it doesn’t give the developer much context as to why these changes are necessary.
Credo, too, tells you “what”, but also answers “why”. ...