[fix] Update eslint and prettier configs #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's new in this PR
Removed the Calblueprint Eslint and Prettier packages along with all their peer dependencies and replaced with the Eslint and Prettier configs that are listed in the Expo docs. Also added an Eslint ignore field and removed the organizeImports field in VSCode settings fiel. Then fixed all Eslint and Prettier issues in the project.
Description
This remedy was sought after due to a version mismatch for Typscript, where Expo wanted Typescript version 5 and our Calblueprint eslint config package was using a lower version. Due to the difficulty of keeping up the Calblueprint eslint and prettier packages to match with changes in other packages and version matching with tools such as Expo and NextJS, I felt it best to just use the maintained packages that were recommended on the Expo docs for this PR as they encompassed most, if not all, the rules we were requiring.
The Eslint ignore file was added to speed up running eslint by not running it on unnecessary folders. The organizeImports field on the VSCode settings.json file was removed because it was conflicting with the Eslint import order rules.
How to review
Once devs have rebased or pulled changes from main, run npm install to get all the new packages for the project.
Try to run the following commands:
Also just check to make sure that if you're using VSCode, that saving a file with prettier errors like mis-aligned tabs, etc. get fixed upon saving a file.
I also linted the repo with the new rules, and so I had to manually change a little bit in the files of supabase.ts, Account.tsx, signup.tsx, and onboarding.tsx. So maybe make sure those are working as expected, although I expect them to be.
Next steps
You all on your project may find that certain Eslint and Prettier rules are not ideal (usually these are on the styling end of the spectrum) or you would like to have some other ones that may be missing, so feel free to play around with the .eslintrc.js and .prettier.js or install other eslint packages to help get you to a code ruleset that feels right for you.
Relevant Links
https://docs.expo.dev/guides/using-eslint/
https://www.headway.io/blog/react-native-quick-start-expo-eslint-typescript-and-prettier
Online sources
Related PRs
CC: @akshaynthakur