profilecity / vidur

Vidur - Recruiting OS for forward thinking companies.
https://profilecity.xyz/vidur
Other
194 stars 84 forks source link

Configure prettier #94

Closed shivam-sharma7 closed 1 week ago

shivam-sharma7 commented 3 weeks ago

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

amandesai01 commented 3 weeks 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.

shivam-sharma7 commented 3 weeks ago

@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.

amandesai01 commented 3 weeks ago

Go ahead, add the precommit hook as well!

amandesai01 commented 3 weeks ago

@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.

shivam-sharma7 commented 3 weeks ago

@amandesai01 Please, give me error logs or screenshort.

amandesai01 commented 3 weeks ago

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.

shivam-sharma7 commented 2 weeks ago

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

amandesai01 commented 2 weeks ago

Let's circle back on this next week, I am busy with finalising v1.