visual-studio-2012 - Visual Studio 错误列表 : Ignore a JavaScript reference

标签 visual-studio-2012 typescript chutzpah error-list

可能有三个人在做我正在做的事情,但这里是:

  • Visual Studio 2012
  • 最新网络精华
  • TypeScript 项目
  • AngularJS 框架
  • 使用 Jasmine 运行 Chutzpah 测试

在为 Chutzpah 创建测试时,我不仅需要添加对我的 typescript 文件的引用,还需要添加对我正在使用的 javascript 库的引用。例如:

// Typescript References (for tsc)
/// <reference path="../ref/angular-1.0.d.ts" />

// JavaScript references (for chutzpah)
/// <reference path="../lib/angular.min.js" />

// TS references for what we're actually testing...
/// <reference path="../src/modules.ts" />

使用此设置,我的 typescript 编写的 jasmine 测试运行良好。但是,angular.min.js 文件用数百个投诉填满了我的错误列表。这使得无法找到 typescript 语法检查器报告的错误。

如果我删除对 angular.min.js 的引用,那么 Chutzpah 将无法运行,因为我的代码依赖于该库。

有没有办法强制 Visual Studio 忽略特定 JavaScript 文件引用中的错误?

最佳答案

此问题现已在 Chutzpah 2.4 中解决.

Chutzpah Specific Reference

With the addition of TypeScript support a few releases ago several people reported issues when using Chutzpah with the TypeScript plugin in VS. The problem occurs since both TypeScript and Chutzpah are using the comments for different purposes. To get around this issue Chutzpah now supports two ways to reference dependent files.

  1. The existing general way /// <reference path="foo.js" />

  2. The new Chutzpah specific way /// <chutzpah_reference path="foo.js" />

Using the latter will let Chutzpah know about your dependency graph and should not confuse the TypeScript compiler.

关于visual-studio-2012 - Visual Studio 错误列表 : Ignore a JavaScript reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14487388/

相关文章:

angular - 发送消息或在angular2中打开消息后,如何使页面自动向下滚动到底部

python - Pycrypto 在 Windows 上构建 pycrypto 的轮子失败

asp.net 编译时错误 - 对象引用未设置到对象的实例

javascript - 在 Angular 的 ngIf 条件中使用拆分函数

angular - 如何在 Angular 中订阅服务

angularjs - Visual Studio 中的 Angular 单元测试失败

javascript - 使用 Chutzpah 时 Typescript 断点失败

.net - 为什么我的项目中同时存在 EntityFramework 和 System.Data.Entity 程序集?

c++ - "The breakpoint will not currently be hit"- 我无法添加 .pdb 文件

javascript - ko 未定义 厚颜无耻的错误