Skip to content
This repository was archived by the owner on May 22, 2021. It is now read-only.
This repository was archived by the owner on May 22, 2021. It is now read-only.

Lint and auto-format code on a git precommit hook? #405

@pdehaan

Description

@pdehaan

Ref: #404 (comment)

I like how testpilot-ga does it by using husky and lint-staged.

https://medium.com/@netczuk/your-last-eslint-config-9e35bace2f99


Pros:

  • This would make sure that ESLint and prettier get run locally before each commit/push.
  • Would make less of a burden on Circle-CI since I wouldn't have to wait for a build to fail just to see that I forgot a semi-colon because peter forgets to run npm run lint locally.

Cons:

  • If we run prettier on a hook, unrelated code could get shuffled slightly. Not sure if lint-staged and our current globs would lint only those staged files, or if Prettier would touch everything. Worst case is we try it and see, and can easily revert if we don't like it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions