aleph.js
aleph.js copied to clipboard
Enable type checking
If the ts or tsx source code contains type errors, they are ignored by aleph dev and aleph build.
Steps to reproduce
Create this about.tsx page that assigns a number to a string type:
import React from 'react'
const x: string = 123
export default function About() {
return <h1>Test {x}</h1>
}
Run aleph build. I expected the build to fail, but it only logged INFO Done in 884ms
Do I have to run a separate command for type checking?
At least the integration with Visual Studio Code works great, as it reports the problem Type 'number' is not assignable to type 'string'. (deno-ts)
Version
aleph.js v0.3.0-beta.10
deno 1.13.2 (release, x86_64-unknown-linux-gnu)
v8 9.3.345.11
typescript 4.3.5
We are using swc to transpile code to resolve jsx/import-maps..., that just strips the types, but seems it will support type-check in the future, please check https://github.com/swc-project/swc/issues/571
traspiling is different from typechecking. swc works correctly when it just strips typescript code, because that's how it works.
Babel typescript works the same way. The only way to integrate typechecking is through tsc provided by typescript
This is very important. What's the point of using TypeScript if there's no type checking? 🤦