https://github.com/talento90/js2ts-demo
Demonstration how to migrate a project from JavaScript to TypeScript
https://github.com/talento90/js2ts-demo
javascript migration typescript
Last synced: about 2 months ago
JSON representation
Demonstration how to migrate a project from JavaScript to TypeScript
- Host: GitHub
- URL: https://github.com/talento90/js2ts-demo
- Owner: Talento90
- License: mit
- Created: 2019-01-08T19:46:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-30T22:36:28.000Z (over 7 years ago)
- Last Synced: 2025-06-29T06:07:12.189Z (12 months ago)
- Topics: javascript, migration, typescript
- Language: JavaScript
- Size: 52.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js2ts-demo
Demonstration how to migrate a project from JavaScript to TypeScript
## Migration
- Install TypeScript `npm i --save-dev typescript`
- Install Definitions `npm i --save-dev @types/node @types/hapi@16`
- Setup tsconfig.json `node_modules/.bin/tsc --init`
- Set the following compiler options: `"allowJs": true, "checkJs": true`
- Rename .js files to .ts
- Fix errors and go to the previous step
### References
* JSDOC - http://usejsdoc.org
* Migrating from JavaScript - https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html
* Type Checking JavaScript Files - https://github.com/Microsoft/TypeScript/wiki/Type-Checking-JavaScript-Files