w3cj / use-x

Practice implementing custom react hooks with full test suites and examples.
https://www.youtube.com/watch?v=GDXsuoisg60
MIT License
12 stars 4 forks source link

Prettier disabled, how to format? #1

Open Arinji2 opened 1 month ago

Arinji2 commented 1 month ago

heya, quick question but why is the default formatter disabled for this challenge? I quite like prettier with its vscode extension lol, is there any reason + can we remove your vscode settings and use prettier?

w3cj commented 1 month ago

This repo is set up to use eslint with "auto-fix" on save. As long as you have the eslint extension installed, you'll get a similar experience to prettier's auto format on save. If you want to fix manually, you can press CMD/CTRL+SHIFT+P and search for "Eslint: fix all auto fixable problems"

The eslint config I'm using has all the settings you'd need for formatting via ESLint Stylistic - I've been using this config lately and much prefer it over eslint+prettier or prettier alone.

You can update the formatting settings in here: https://github.com/w3cj/use-x/blob/main/eslint.config.js and see all of the customization options available here

If you still want to use prettier instead, you can enable it in the settings file here: https://github.com/w3cj/use-x/blob/main/.vscode/settings.json#L3 and add the prettier config from here: https://github.com/prettier/eslint-config-prettier

Arinji2 commented 1 month ago

Yea my bad, i didnt know there was an eslint extension xD (its actually awesome lol.. i used to depend on nextjs build linting to check react deps issues lol, so thanks for this)

Anyways i forked the repo and am writing my own implementation :D Will comment once done.

Thanks for this btw, its really awesome + the test suite is great.

w3cj commented 1 month ago

No worries! Glad its working. Not using prettier is less common these days, so I understand the confusion.

w3cj commented 1 month ago

Keeping this open in case anyone else has the same question.