我使用 webstorm 编辑代码, 总是提示 cc.d.ts 中有 20+ 个错误. 自己尝试过几个版本的 tsc 编译也会出现一堆错误.
这原本不影响运行, 直到现在,
我需要用脚本预处理代码, 这个过程会用到 tsc 编译, 由于这个问题, 脚本走不下去.
为什么脚本不用 babel ? 因为我有许多自定义 @装饰器, babel 装饰器逻辑有问题, 我需要用 tsc 预处理自己的代码后再输出到 assets
-
Creator 版本: 3.4.1
-
重现方式:使用 tsc 4.5.5 (以及其它版本) 编译: tsc -p tsconfig.json 或者 webstorm 右下角 “typescript - Compile”
-
首个报错: …declarations/cc.d.ts:27710:9 - error TS2416: Property ‘on’ in type ‘SystemEvent’ is not assignable to the same property …