Closed shivam-sharma7 closed 1 week ago
we already have a prettier config in place. See .prettierrc
.
It would be great if you can enable .vscode
setting to respect the formatter and not mess up code unnecessarily.
@amandesai01 Yes, But I did this with npm mean if someone run npm run format
then it will automatically format all modified codebase and we can also configure precommit hook- https://typicode.github.io/husky/ which will validate code format before making commit.
Go ahead, add the precommit hook as well!
@shivam-sharma7 please reopen the PR. your current changes are not respecting the prettier config, which is causing issues.
For example, run prettier, change printWidth and run prettier again. You will see that changes won't take effect.
@amandesai01 Please, give me error logs or screenshort.
I am not getting any error. It's just that files are not getting formatted as expected. Did you follow the reproduction step?
Run prettier, change printWidth and run prettier again. You will see that changes won't take effect.
It's just that files are not getting formatted as expected.
@amandesai01 Which kind of file not formatted? like - vue or something but all .ts
file getting formatted in my machine. I have not attached them with this PR #95
Did you follow the reproduction step?
Yes, and it is working for .ts
file. For vue I'm getting some error this is why I have't include .vue
in config you can see here- https://github.com/shivam-sharma7/vidur/blob/3449d44aa70505e5afa50e8ca64e8462a106a80f/package.json#L14
Let's circle back on this next week, I am busy with finalising v1.
Prettier is an opinionated code formatter
check docs-https://prettier.io/docs/en/
Also, I have created a branch which you can pull and test -> https://github.com/shivam-sharma7/vidur/tree/code-formatter
@amandesai01 @devshahofficial