A checker for the glass-easel project in MiniProgram file structure
npm install glass-easel-miniprogram-typescriptAn extra TypeScript checker for mini-program code running in glass-easel.
Refer to the glass-easel project for further details.
If the component is written in TypeScript, this tool can do some type-checking on expressions inside WXML.
Firstly, the component .ts must export the component as default. For example:
``ts`
export default Component({
data: {
hello: 'world',
},
})
Then in .wxml :
`xml{{ hello }}
This tool is based on TypeScript (a.k.a.
tsserver ) for type-checking.Note that it only report errors in component WXML files. For type errors in TS files, you should run standard TypeScript commands.
Usage
After install this module, the
miniprogram-typescript-check tool should be available.See all options:
npx miniprogram-typescript-check --helpIn most cases, this command is suggested:
npx miniprogram-typescript-check -p [PATH_TO_SRC]`