lmnr-ai / lmnr

Laminar - open-source all-in-one platform for engineering AI products. Traces, Evals, Datasets, Labels. YC S24.
https://www.lmnr.ai
Apache License 2.0
1.09k stars 53 forks source link

Add pnpm lint:fix (or eslint --fix) as a pre-commit hook #125

Open dinmukhamedm opened 1 week ago

dinmukhamedm commented 1 week ago

We need to add a pre-commit hook to lint the code in order to avoid having to recommit just the lints. This might be especially frustrating for outside contributors.

Here's a couple good guides:

  1. https://levelup.gitconnected.com/how-to-run-eslint-using-pre-commit-hook-25984fbce17e
  2. https://gist.github.com/estorgio/e8bcaa8e87d0fcdcf85fdf598956e34c

Note: we probably just need eslint, and maybe optionally prettier

lucky29-git commented 1 week ago

@dinmukhamedm Can I work on this? I never added a pre-commit hook before, this looks something new to me. I would like to work on this.

lucky29-git commented 1 week ago

/assign

dinmukhamedm commented 1 week ago

Sure, you can. Ideally, I would like that nobody has to install the pre-commit cli command, especially for it's downloaded from pip... @lucky29-git Let's work together to check if it's enough to install it once when creating/testing the hooks, but not when using them

lucky29-git commented 1 week ago

Sure @dinmukhamedm, let me do some research, I will get back to you soon on this.