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

Convert JS to TypeScript #57

Open
behives opened this issue Jan 27, 2022 · 4 comments · Fixed by #90
Open

Convert JS to TypeScript #57

behives opened this issue Jan 27, 2022 · 4 comments · Fixed by #90

Comments

@behives
Copy link
Member

behives commented Jan 27, 2022

@jsanter27 please add high level description and specific target for 22PI1 here....thank you!

@jsanter27
Copy link
Collaborator

The methodical conversion to TypeScript should be done as we implement the new modular packages described in #58. To ensure best practices and solidarity in code styling, we will use a combination of ESLint, Prettier, and Husky in our TypeScript configuration.

Configuration

tsconfig.json

This is the file where we define the rules for our TypeScript project. For best practices, it is recommended to be as strict as possible with the rules. Strict rules may lead to more "development" time, but will save time in the long run by catching possible errors as soon as possible.

ESLint

ESLint statically analyzes your code to quickly find problems. ESLint is built into most text editors and you can run ESLint as part of your continuous integration pipeline. Many problems ESLint finds can be automatically fixed. ESLint fixes are syntax-aware so you won't experience errors introduced by traditional find-and-replace algorithms. Preprocess code, use custom parsers, and write your own rules that work alongside ESLint's built-in rules. You can customize ESLint to work exactly the way you need it for your project.

We will use this in the ZEBRA project to find errors in our TypeScript code before it is run. It will also be configured with Prettier to enforce consistent code styling on save.

Prettier

This is an opinionated code formatter that supports many languages, integrates with most editors, and has few options
Why are we using it? We press save and code is formatted. There will be no need to discuss style in code reviews, and saves us time and energy. A full list of what options can be used can be found here.

Husky

This command interface can be used to lint your commit messages, run tests, lint code, etc... when you commit or push. This adds another layer of CI/CD on the client side to ensure that the code is safe and good to go before even reaching GitHub.

Goals

  1. Create tsconfig.json file with strict typing rules
  2. Configure ESLint to work with Prettier and Husky

@varshith257
Copy link

@behives I would like contribute for this migration and starting work with migrating some files

@asr2003
Copy link

asr2003 commented May 20, 2024

I'd like to work on this migration work.
@varshith257 Could you also mention the files you starting with work. So that we could not get collapsed on working on same files

@varshith257
Copy link

Sure will post here

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

Successfully merging a pull request may close this issue.

4 participants