Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint, stylelint, prettier, and pre-commit #484

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

maco
Copy link
Contributor

@maco maco commented Dec 17, 2020

Changes

  • When you try to commit, Pre-commit will run checks for all three, if
    installed, only on staged files, and prevent committing if the linters are
    unhappy.
  • Several eslint rules that generate a lot of errors are disabled for now.
    That's to allow a more gradual transition, so you won't change 1 line and be
    told to fix 100 other lines (but maybe like 20 because there are still a lot
    of rules enabled).
  • Prettier is set to require pragma. That's also to allow a more gradual
    transition. As each file is tidied up, run Prettier on it, and it'll add a
    special comment that tells it that it's now responsible for keeping that one
    tidy.

Oh, and Pre-commit supports custom hooks, too, though there is already one for mix format and mix test. It's the language-agnostic choice for git pre-commit hooks.

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

- When you try to commit, Pre-commit will run checks for all three, if
  installed, _only_ on staged files, and prevent committing if the linters are
  unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
  That's to allow a more gradual transition, so you won't change 1 line and be
  told to fix 100 other lines (but maybe like 20 because there are still a lot
  of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
  transition. As each file is tidied up, run Prettier on it, and it'll add a
  special comment that tells it that it's now responsible for keeping that one
  tidy.
@ukutaht
Copy link
Contributor

ukutaht commented Dec 23, 2020

Thanks!

@ukutaht ukutaht merged commit e95ff80 into plausible:master Dec 23, 2020
oliver-kriska pushed a commit to payout-one/analytics that referenced this pull request Dec 23, 2020
- When you try to commit, Pre-commit will run checks for all three, if
  installed, _only_ on staged files, and prevent committing if the linters are
  unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
  That's to allow a more gradual transition, so you won't change 1 line and be
  told to fix 100 other lines (but maybe like 20 because there are still a lot
  of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
  transition. As each file is tidied up, run Prettier on it, and it'll add a
  special comment that tells it that it's now responsible for keeping that one
  tidy.
@PascalPixel
Copy link

The prettier config on this is broken currently, for whatever reason, this fixes it; #2150

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants