-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#671: configured prettier for new developers #683
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @River-unknown! Thank you so much for this contribution.
I am not a fan of the pre-commit hook approach. Few things in this world scare me as much as the idea of my code changing invisibly right before I commit it.
I would prefer to rely on editor integrations alongside something like a test:lint
or test:format
script in package.json which can be run locally or in CI.
I'd also like the readme to be minimally affected by this stuff. We don't need lots of instructions - just a mention of the plugin should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @River-unknown - thanks again for the changes. I've taken another look and I've got a couple more comments for you.
README.md
Outdated
You can also manually format files using Prettier by running the following command: | ||
|
||
```bash | ||
npm run format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this repo we usually use pnpm
, so this needs to be pnpm run format
package.json
Outdated
@@ -28,7 +32,9 @@ | |||
"@types/gunzip-maybe": "^1.4.0", | |||
"@types/rimraf": "^3.0.2", | |||
"@types/tar-stream": "^2.2.2", | |||
"eslint": "^8.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove eslint
and the lint commands - between TypeScript's compiler and prettier's formatter, we should be well covered. Thanks!
Hi @River-unknown - I'd love to get this work finished off! Can you spare a bit more time to make the final changes? |
Sure sir... I will complete it in 2-3 days.. |
Hi @River-unknown, if you're not able to complete this work soon I will need to close this PR and open the issue to other new contributors. I don't think there's a lot of work outstanding. If you are having difficulties with any particular point please let me know and we can discuss |
Ya working on it. I will be by tomorrow push certain changes about the issue. |
Resolved conflicts
having issue with resolving confliicts in the pnpm-lock.yaml and am not sure how to resolve that. |
HI @River-unknown you need to merge the main branch into yours and run |
@@ -28,7 +30,7 @@ | |||
"@types/gunzip-maybe": "^1.4.0", | |||
"@types/rimraf": "^3.0.2", | |||
"@types/tar-stream": "^2.2.2", | |||
"gunzip-maybe": "^1.4.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what happened here but we still need this dependency!
If I run:
From root, I get this error:
I also have diffs in my EDIT: to be clear it's correct to check the src dir, but I think you want this pattern:
|
package.json
Outdated
@@ -28,7 +31,7 @@ | |||
"@types/gunzip-maybe": "^1.4.0", | |||
"@types/rimraf": "^3.0.2", | |||
"@types/tar-stream": "^2.2.2", | |||
"gunzip-maybe": "^1.4.2", | |||
"prettier": "^3.2.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we lock the prettier version to 2.8.8?
It's a bit silly but that's what the repo currently uses. If we use 3.0 a lot of defaults change and we suddenly start seeing an awful lot of changes
I don't want to go through and check all those reformatting diffs. But if we lock it to 2.8.8 we should get a much smaller number of changes, and I can open a new issue to update to pretter 3.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just run prettier 2.8.8 against main and merged the diffs.
So on your branch right now, pnpm test:format
should FAIL because it's detecting formatting changes.
After you merge main
again, it should pass, and pnpm prettier
should generate no diffs
I just merged main branch into my branch as you said and it happened to be like this. And am not quite sure of that pnpm-lock.ya file matter and for that test i think by mistake i had deleted something i am not sure. I will check back on and will update soon |
Ah @River-unknown I see the problem - you're on a more advanced I guess we ought to update that soon for now, but for now could you please set your pnpm to version 8.x and re-install from there? The problem is that your pnpm has updated the lockfile version and changed everything. |
Ahh ok @josephjclark will update to those versions. |
@josephjclark can you please review . I had locked the prettier version to 2.8.8 and also reinstalled pnpm and its dependency with its version 8. |
Great @River-unknown - thank you for all your hard work 🙏 I'll merge this into our repo now, run some final tests, and merge to main in the morning |
Short Description
Worked on the issue for ensuring prettier gets configured.\
Issues
Closes #671