打字:PHPStorm中意外的保留字 [英] Typescript: unexpected reserved word in PHPStorm
问题描述
我试图获得一个简单的TypeScript文件工作在PHPStorm,但可惜的是,似乎有一些配置错误,因为类关键字无法正确识别
I´m trying to get a simple TypeScript file working in PHPStorm, but sadly there seem to be some misconfiguration by default as the class keyword is not recognized properly
这是我的TypeScript文件:
class Test{
}
这是我面对的错误:
这是我的TypeScript的FieWatcher配置
如何让TypeScript工作?
How can I get TypeScript working?
推荐答案
程序
选项不应该是 node.exe
意味着你试图将脚本代码作为javascript)。它需要 tsc
或节点tsc
(这意味着您要运行tsc将文件编译为javascript)。
The Program
options should not be node.exe
(that would mean you are trying to typescript code as javascript). It needs to be tsc
or node tsc
(that means you want to run tsc to compile the file to javascript).
PS:此影片可能有帮助: https://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
PS: this video might be helpful : https://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
这篇关于打字:PHPStorm中意外的保留字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!