-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor to typescript #50
base: main
Are you sure you want to change the base?
Conversation
- install types and necessary dependencies; - add TypeScript configuration; - change extention of files to .tsx; - add User and Item types.
…rn in the input element
… List component; removed temporary console.log from Home component
…n in case userId or userEmail is undefined
src/api/firebase.ts
Outdated
userId: string | null | undefined, | ||
userEmail: string | null | undefined, |
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 wonder if this might simplify a little bit
userId: string | null | undefined, | |
userEmail: string | null | undefined, | |
userId?: string | null, | |
userEmail?: string | null, |
tsconfig.json
Outdated
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"jsx": "react-jsx", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": ["src"] | ||
} |
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.
The build works on my end now with the vite command.
I wonder if it was the file name change from vit2.config.js > vite.config.ts that did it.
I also see the built files in /build
too which makes things nicer. 🙌🏻
…and firebase.ts; - add types to firebase functions; - add types to a new deleteItem function;
Visit the preview URL for this PR (updated for commit 0400b4c): https://tcl-75-smart-shopping-list--pr50-refactor-to-typescri-pom1hab6.web.app (expires Fri, 04 Oct 2024 14:54:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1f1fd53c369e1fa31e15c310aa075b4e8f4f8dde |
- ensure that values passed into the functions are not undefined; - update pros typing in order to support intellisense onhover; - add onhover description of deleteItem function.
…ull, replace null with /
…ns to support intellisense hovers
Description
This code proposes refactoring our application to TypeScript. These changes will keep the app type safe, scalable and easy to read and to debug.
Some console logs are still in place as the work is still in progress.
Issue
closes #56
Type of Changes
enhancement
Updates
Added types.
Issues
Testing Steps / QA Criteria
npm start
and navigated to localhost:3000,