Skip to content
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: correct typescript types usage across the application #212

Closed
0-vortex opened this issue Aug 16, 2022 · 4 comments
Closed

refactor: correct typescript types usage across the application #212

0-vortex opened this issue Aug 16, 2022 · 4 comments

Comments

@0-vortex
Copy link
Contributor

We have a standardized way of using types across backend and frontends:

  • all of them are declared interfaces unless you specifically need to use that type in generics
  • global types are stored in something next to App.tsx that represent type files like index.d.ts, global types mean they are not used in any of the components, but some pages do need it like database repositories, contributors
  • all other types except props go into the same component that defines them, regardless which other components needs them, next to the props, all these interfaces being exported don't need a different folder structure or separation

These patterns currently cover all our typescript usage across different repositories. Any other things we might feel we need ping here! 🍕

@bdougie
Copy link
Member

bdougie commented Aug 16, 2022

Thanks for opening this. I didn't have enough context on the index.d.ts file in the hot repo, but did grab from it.

@0-vortex
Copy link
Contributor Author

Declaration files are a huge part of typescript and most React frameworks use it in some form of another to define environment variables, nextjs people generally put a next-env.d.ts in the root or modify the next.config.js file. Similar pattern for vite as it is a borrowed aspect

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.3.0-beta.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants