npx tsc --init
$ tsc --init
[1] $ tsc -v
[2] If the version is older than 1.6:
$ npm install -g typescript
[3] $ tsc --init
// mytsconfig.
{
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"typeRoots": ["src/types", "node_modules/@types"],
"baseUrl": "src",
"paths": {
"@/*": ["*"] // matching @src/* to src/*
},
"outDir": "dist",
"experimentalDecorators": true,
},
"exclude": ["node_modules", "dist"],
"include": ["src/**/*","src/*"]
}
{
"compilerOptions": {
"experimentalDecorators": true,
"jsxImportSource": "preact"
}
}