有时需要调用其它语言生成的 ts 代码,因为是生成的,很多语法不规范,会导致无法编译或者运行
如果不规范的地方很多,每个地方去更改,效率很低
效率最高的做法是去每个文件顶部添加 // @ts-nocheck

首先进入 ts 的文件夹,然后运行 shell 脚本:

find . -name "*.ts" -type f | while read file \
do \ 
  echo -e "// @ts-nocheck\n$(cat $file)" > $file \
done

添加新评论