kiesraad / abacus

Abacus, software voor verkiezingsuitslagen en zetelverdeling
https://kiesraad-abacus.pages.dev
European Union Public License 1.2
17 stars 6 forks source link

Add no console lint rule #278

Closed lkleuver closed 2 months ago

lkleuver commented 2 months ago

Add a rule that prevents committing console.log statements (warn and error are allowed) the rule is only active when running through lefthook but not during development.

lkleuver commented 2 months ago

I don't mind enabling the rule all the time without the 'development/production' difference.

If we do want to only enable it for 'production' we need to change the GitHub Actions check to also include the new environment variable.

I quite often use console.log during development (hence this PR) so enabling it in dev gives a constant stream of errors.

praseodym commented 2 months ago

I changed it so that npm run lint uses ESLINT_ENV=production, that should still leave the rule disabled in your IDE (I assume it calls eslint directly). This way it is also enabled in GitHub Actions.