Keep everything in your repository

A few weeks ago I suggested that you should integrate the usage of Linters into your projects as a first step in monitoring and improving your code’s quality.

If you went that way (or if you are using Linters a longer time already) you most likely adjusted the given rules for your code. Many people start to use ESLint with ReactJS and the Airbnb ruleset. This is totally fine. I bet you didn’t like some of their rules, though. You adjusted them. And perhaps you commited the .eslintrc.yml to your repository? If you did so, that’s not bad.

I would kindly suggest one small change:

Create a new repository where you keep all your Linter configuration files (.eslintrc.yml, scss-lint.yml, .rubocop.yml etc.). As a next step you clone the new repository to your developers’ computers.

This makes it easier to use the rules in a new project. All projects will be consistent in which rules they use. Your team can cooperate on designing new rules (or changing existing ones) and everybody is only a git pull away from receiving the new rules.

If you want to get fancy, you can work with symlinks in your projects, so you never need to copy and paste the files. This adds a step to your CI workflow: You have to clone the linter-repo there as well. Otherwise your lint jobs cannot work properly.

Similar Posts:

Leave a Reply