question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run pre-commit (eslint, prettier) in both docker & local

See original GitHub issue

We use husky to run eslint before committing but this doesn’t work when running docker. Warning:

Can't find Husky, skipping pre-commit hook
You can reinstall it using 'npm install husky --save-dev' or delete this hook

We want this to work for people working with and without docker. Here is one potential resolution but it might work only for docker: https://github.com/MadeInHaus/react-starter/pull/30/files

EDIT: The above linked example is also not appropriate because we have multiple npm projects.

Needs to be added to both client/package.json & backend/package.json

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mannykarycommented, Aug 13, 2020

I think for the short-term we can just follow this method as @joshmorel mentioned as we will likely break up frontend and backend into separate repos at some point. They will likely be independently deployable and independently scalable as well since as @robinv85 mentioned there are more frontend clients/consumers of the backend API than just the React web frontend, and as it’s currently set up, the other clients would have to connect directly to the web frontend container to be proxied to the backend for any API call it needs to make. So this would put unnecessary strain on the web frontend container.

As for Docker Compose, it’s obviously going to be a bit more complicated with services being in separate repos, but I think that can be easy to solve if we create a shell/parent repo that references the other repos with git submodules. Symbolic linking is also another option. We can then run the Cypress e2e tests from this repo.

0reactions
tejasm2commented, Aug 25, 2020

Thanks @joshmorel

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pre-commit Hook - Prettier
You can use Prettier with a pre-commit tool. This can re-format your files that are marked as “staged” via `git add` before you...
Read more >
Writing an ESLint Hook for Pre-Commit | Python in Plain English
First, configure your ESLint set up locally. There's a good guide on this here; in short, you can just run npx eslint --init...
Read more >
Setup eslint/prettier on docker + host · Issue #1 - GitHub
This issue aims to describe how if you setup docker on a fullstack project, you may loose some developer experience like in-editor linting...
Read more >
Angular with Eslint, Prettier, husky | by Stavros Droutsas
In this article, we will create a new Angular project and we will configure eslint, prettier and husky. Linters and git hooks are...
Read more >
Automatically format and lint code with pre-commit - Interrupt
How to use pre-commit for automated linting, formatting, and styling firmware code by using Python, clang-format, clang-tidy, and prettier.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found