TypeScript

XylemJS has built-in support for TypeScript.

To use typescript, install Typescript:

npm install typescript --save-dev

After installation, generate tsconfig.json file:

npx tsc --init

It is recommended to update the generated tsconfig.json file with the following configuration:

{
	"compilerOptions": {
		"target": "ESNext",
		"module": "Preserve",
		"sourceMap": true
	}
}

A complete tsconfig.json may look like this:

{
	"compilerOptions": {
		"target": "ESNext",
		"module": "Preserve",
		"sourceMap": true,
		"forceConsistentCasingInFileNames": true,
		"strict": true,
		"skipLibCheck": true
	}
}