1. Install Typescript and types
2. Create a tsconfig.json file
3. Set up your scripts to run tsc and then access the outputted .js files
4. Tweak your file structure to hold src and dist folders
5. Check your project still works

ref: https://medium.com/@mhuckstepp/step-by-step-guide-to-convert-an-existing-express-node-js-backend-to-typescript-931e435ea95d
ref: https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html
ref: https://plainenglish.io/blog/how-to-convert-node-js-code-from-javascript-to-typescript-8e7d031a8f49Javascript can easily be converted to TypeScript
though it requires some efforts for a big project

read this
https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html
https://www.tutorialsteacher.com/typescript/converting-javascript-to-typescript
1. Add tsconfig.json file to project
2. Integrate with a build tool
3. Change all .js files to .ts files
4. Check for any errors const  Validacao =() => {
     const {getFieldProps, handleSubmit, isValid} = useFormik({
        initialValues: {
            name:'',
            contact:{
            email:'',
            phone:''
        }
       },
       validate: values => {
        const err ={}
        const message= ' campo obrigatorio'
        if(!values.name) err.name = message
        if(!values.contact.email) err.email = message
        return err
    },
    onSubmit: (values, bag) => {
    console.log(values)
  }
})
const [name, metadataName] = getFieldProps('name','text')
const [email, metadataEmail] = getFieldProps('contact.email', 'text')
const [phone, metadataPhone] = getFieldProps('contact.phone', 'text')var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
  acc[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var panel = this.nextElementSibling;
    if (panel.style.display === "block") {
      panel.style.display = "none";
    } else {
      panel.style.display = "block";
    }
  });
} require
  (["esri/config","esri/Map", "esri/views/MapView"],

      function (esriConfig,Map , MapView)
          {
            esriConfig.apiKey = "AAPKb4dd8a4b511d47db90c8eb0dcd2f50dcUqecvStaAu60DxJYTEyki8OncuffK0-bbJeKr_N678ONK4QAkTDPYa8wI5Wkeksr";

            const mymap = new Map({
              basemap: "arcgis-topographic" // Basemap layer service
            });


            const view = new MapView({
              map: mymap,
              center: [-118.805, 34.027], // Longitude, latitude
              zoom: 13, // Zoom level
              container: "viewDiv" // Div element
            });
          }
      );
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');     case '/local/forgot':
         if( req.method==='POST' ) {
            const email=req.body.email.toLowerCase();
             return server.get_user_by_email( email ).then ( p => {
                 if ( p ) {
                     server.push_token( p, common.get_uuid() );
                     return res.redirect(`/auth/local/email_sent?email=${email}`);
                 }
                 else

                     return res.redirect(`/auth/local/forgot`);
             });
         }
     case '/local/forgot':
         if( req.method==='POST' ) {
             const email=req.body.email.toLowerCase();
             return server.get_user_by_email( email ).then ( p => {
                 if ( p ) {
                     server.push_token( p, common.get_uuid() );
                     return res.redirect(`/auth/local/email_sent?email=${email}`);
                 }
                 else

                     return res.redirect(`/auth/local/forgot`);
             });
         }
     update_password( password, user_token ) {
         this.mongodb.collection( "users" ).updateOne( { [`password_recovery_tokens.${user_token}`]: {$exists: true}  }, {$set : { password : crypto.createHash('sha256').update(password).digest('base64') } } )
     }
     update_password( password, user_token ) {
         this.mongodb.collection( "users" ).updateOne( { [`password_recovery_tokens.${user_token}`]: {$exists: true}  }, {$set : { password : crypto.createHash('sha256').update(password).digest('base64') } } )
     }

TypeScript相关代码片段

vite dev mode only code

copy to clipboard npm package

typescript multiple args

scroller function

form action causes page crash next js

typescript const array includes

next.js get query params

js console.log format

typescript codebase

typescript round to 2 digits

reacvt useQurey

emit an argument for event is not provided

eslint with typescript and nodejs

exists status

how to check text length in angular

get current time ts

cannot import bcrypt

reset form in angular typescript

nextjs get url params api app route

select between brackets vscode macbook

vercel config for express

jest it sleep

tailwindcss-debug-screens

MY_MOMENT_FORMATS LT

nextjs multiple image hostnames

DatetimeFormatOptions typescript

typescript generic

typescript Dictionary

npm circuit breaker

angular httpinterceptor + for file uploads

comments using regex

nestjs client streaming grpc client

nodejs curicuit breaker

data table tanstack custom pagination number

typescript interface react

typescript get keys of type

jest testing ts

jest sleep between tests too many requests

disable prop types eslint

exports is not defined

ts any key in object

cypress configure browser size

i18next change language

i18n change language

nextjs 14 route api creation

i18next check current language

arc shortcuts windows

sequelize relation where

typescript omit for enums

setup TypeScript in tsconfig.json

typescript is checking types from user directory

vite.config.ts resolve

zod one of string

sequelize where relationship

collapsable sidebar shadcn

ts disable its value is never used

rtk query programmatically

papa parse convert to object

Overflow:hidden dots at the end

awaited typescript

typescript print to console

git how to view all commits before push

how to use external fonts in react

change shadcn select placeholder color

ts get type of object values

How to add todo

zod error message

tailwindcss screen debugger in nextjs

does fcm automatically starts on reboot?

run vite app

max amount validator

redis client type typescript

omit more than one typescript

vscode md snippets for mdx also

check if user exists firebase

add custom class in tailwindcss

initialize array of specific size

typescript create type from array of strings

shadcn dialog programmatically

nodejs file stream