Question: Is there a way to use lint-staged with git submodules?
See original GitHub issueWe have a folder that is shared between some of our project. We have made it into its own git repo and added it as a submodule to the projects. The configurations of the project are always in sync (or they should be), and we treat the submodule as a simple folder.
The problem is that lint-staged
won’t report the changed files inside the submodule to our code formatter. This has made us run a full reformat of the whole code base on each commit.
Is there a work around this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Question: Is there a way to use lint-staged with git submodules?
We have a folder that is shared between some of our project. We have made it into its own git repo and added...
Read more >Using Husky Git Hooks and Lint-Staged With Nested Folders
cd into the directory with your package. · Install husky and lint-staged: · Add a “prepare” npm script to your package. · Run...
Read more >Pre commit hook checks for source lint (not staged)
It will only lint the staged files, which is really efficient. That means that it would force the developer in your example to...
Read more >gitmodules Documentation - Git
Defines the default update procedure for the named submodule, i.e. how the submodule is updated by the git submodule update command in the...
Read more >Linting Staged Git Files with lint-staged -- newline - Fullstack.io
This lets you continue working on the application code without any interruptions, and once you are done with the code, you can stage...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, it seems like that thanks to your guidance, I have found a solution to my problem. I can run this:
Just a slightly unrelated question. I have tried to put this into an npm script, but as I am running Windows, I got this error:
Have you got any experience with this? (I think that the problem is probably that git scripts are written in bash, and npm on windows works in cmd environment.)