Legendary ships with a set of reasonable default linter configurations to help enforce consistent code style in your application. This is particularly valuable when working together as a team. However, even when working solo, linters will find some errors in your code and help you to avoid needless changes in the future.
- credo for Elixir
- stylelint for CSS
If you would like to lint your code before every commit, you can use lefthook to do so. We include a lefthook.yml that runs credo, prettier, and stylelint for you.
First, if you do not have it installed already, you will need to
On the Mac with Homebrew, this is as simple as
brew install lefthook. Instructions
for other environments are available in the lefthook documentation linked above.
Then you can install the hooks via
lefthook install. You can test them without
committing by running
lefthook run pre-commit.
.gitlab-ci.yml runs credo, prettier, and stylelint in CI as an
additional consistency check.