Good question Okto.

Before I answer your main question, let me clarify that, even though you can set up prettier rules in eslintrc, "ng lint" command does not actually run prettier. Hence we need to run "prettier" explicitly. As per my experiments, the prettier rules set inside eslintrc are used only by ESLint VS Code plugin to do the magic in the IDE.

So, about "prettier --check", that is purely my recommendation and not a rule to follow. My reason is that I would want the CI to fail if a developer has missed/skipped to format code as per project standards.

Additionally, note that we do not want CI to auto-fix any format or lint issues (i.e. no `ng lint --fix` in CI) because your repository would still contain formatting inconsistencies, until fixed later (which I feel is unnecessary future overhead).

Krishnan Mudaliar
Krishnan Mudaliar

Written by Krishnan Mudaliar

Loves the web • DIY • DRY • ASP.NET • JavaScript • Angular • NodeJS (i/bitsy) • Believer of great UX

No responses yet