feat: common configuration #85
This is an initial PR
#85
Deploy request for staging-firecamp-dev rejected.
| Name | Link |
|---|---|
| Latest commit | d0f1f26114fa19578fc72e765d20bf16fc235d2f |
@bathini79 can you please explain this PR with some description? I need to understand your view on how to use this common code config in the rest of the app.
Gentle reminder here @bathini79
@Nishchit14 Working on it,now! I'll get you with a practical example
@Nishchit14 This is architecture i want to go with: packages: -> firecamp/eslint -> index.js (Contains lint configuration,This is a starting point we can rename it or add more files as needed) Example usage platform: ->firecamp-plaform -> package.json (devDependency) ->eslint (extend @firecamp/eslint)
https://github.com/firecamp-dev/firecamp/assets/116077457/0d5ed264-2bee-4553-967e-d32367556cf3
It looks good to me and I agree with it. thank you for the nice demonstration. @bathini79. what should be the next step? prettier?
@Nishchit14 yes prettier and tsconfig
@Nishchit14 I've included prettier in the same eslint config. Let me know if you want me to configure it differently
@Nishchit14 I renamed the file to common-config , So we can expand the configs. Also Added A Readme File On How to use it.
Great job @bathini79
I think keeping the prettier config separately is a good idea instead of combining it within eslint.
Also, I have doubts about husky. what would be the best way to implement husky for multiple packages in monorepo and use a common husky setup?
@Nishchit14 okay . I agree with you I'll separate out prettier config.i'll check about husky and I'll get back to you
i haved added prettier
I tried husky , Using the same way for prettier etc. But its not working i expected. I'll check once again though . Here's what i found , it is difficult for husky in a monorepo setup in itself, Let alone in a common configuration file is a bit tricky. https://dev.to/mimafogeus2/enforce-git-hooks-in-monorepos-with-husky-but-how-3fma
hmmm, thanks for sharing it. i'll try to find some help here @bathini79
@Nishchit14 let me know what you have found
@bathini79 looking into it, give me a day.
@bathini79 the husky common config is not possible, we need to add it at the whole repo level. that's the way it works, on any commit at the repo level the husky will get triggered to run the staged command.
you can give it a final try by adding Husky at the repo level. then after we would be good to go.
Okay thanks. I'll try by EOD
@Nishchit14 I Pushed the code . I have added pre commit configuration in the root folder and config file in husky . And Also husky config in mono repos .
The Way It Works Is , In Husky Configuration folder we need to add pre-commit hook . We Can Write the script to run we'll stick with pre-commit script .
in this pre-commit script in root package.json we will run other repos pre commit script.
In Husky File I Commented Out the command . So No Body Will Be Blocked to push the code . But After We're ready we can remove the comment