Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Error List: Ignore a JavaScript reference

There are probably like three people doing what I'm doing but here goes:

  • Visual Studio 2012
  • Latest Web Essentials
  • TypeScript project
  • AngularJS framework
  • Running Chutzpah tests with Jasmine

When creating tests for Chutzpah, I need to add references not only to my typescript files but also to the javascript libraries that I'm using. For example:

// 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" />

With this setup, my typescript-authored jasmine tests are running great. However, the angular.min.js file is filling up my error list with hundreds of complaints. This makes it impossible to find errors that are reported by the typescript syntax checker.

If I remove the reference to angular.min.js, then Chutzpah cannot run since my code depends on the library.

Is there a way to force Visual Studio to ignore errors in a particular JavaScript file reference?

like image 756
roufamatic Avatar asked Jan 23 '13 19:01

roufamatic


2 Answers

This issue is now solved in 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.

like image 95
Matthew Manela Avatar answered Sep 24 '22 15:09

Matthew Manela


This is a bug with Chutzpah which the developer now appears to be aware of:

http://chutzpah.codeplex.com/discussions/404083#post1008911

like image 25
Corwin Pierce-Butler Avatar answered Sep 25 '22 15:09

Corwin Pierce-Butler