0.0.4 • Published 2 years ago
@we-mobius/type-check v0.0.4
Type Check
Getting Started
Install as development dependencies:
pnpm add -D @we-mobius/type-checkCreate a script named type-check.{ts|js} for example, and put it in some folder like scripts in your project root directory, with the following content:
import { resolve } from 'node:path'
import { cwd } from 'node:process'
import { checkFile } from '../src/index'
checkFile(resolve(cwd(), './src/index.ts'))Add the corresponding type-check script to your package.json, here I use TypeScript to write my type-check script and run it with tsx, so my script in package.json seems:
{
"scripts": {
"type-check": "pnpm exec tsx ./scripts/type-check.ts"
}
}Done, here we go, run pnpm exec type-check to check your types.
References
- Built with TypeScript.