When adding CI checks, you can gradually increase rigor while easing your codebase into a better place.

Maybe you want to enforce auto-formatting with Prettier as part of your frontend code quality. This is the static analysis layer described by Kent C. Dodds’ “Testing Trophy.”

But your codebase has never been formatted with this tool before, so none of the files meet the standard. This creates a tough choice: do you discard years of version control history and create potentially numerous merge conflicts with a huge formatting PR?

The gradual answer: when you touch the stylesheets, format the one you changed and possibly all of those like it with Prettier. Then add a gradual CI check:

{
 "scripts": {
 "check-types": "prettier src/*.css --check",
 "validate": "npm run check-types && npm run test"
 }
}

As you touch more files, extend the match to more files. Eventually, it will be all files, ., and you’ve incrementally raised your codebase quality.

Note: this was originally posted on LinkedIn.