按照README中的说明克隆了tslint
repository,npm install
和grunt
,并在Visual Studio Code(0.9.1)中打开了该文件夹。查看任何.ts
文件 - src/rules/typedefRule.ts
,比如说 - 在require "typescript"
上给出了TypeScript错误:Cannot find module 'typescript'.
typescript
模块位于node_modules
文件夹中,但VSC似乎并不知道。我怎么告诉它?
答案 0 :(得分:1)
typescript模块位于node_modules文件夹中,但VSC似乎并不知道。我怎么告诉它?
两件事:
vscode
使用的当前版本的打字稿并不支持typings
查找。您需要使用tssdk
设置1.6.2
)使用的当前打字稿没有typings
字段。您还需要更新tslint(更大的任务)。 建议:按照自述文件中的其他步骤操作并使用THEIR定义文件:https://github.com/palantir/tslint#custom-rules