What is this JavaScript reference syntax used in Visual Studio?

In Visual Studio 2012, I created a web application and then found the following line in the standard _references.js script that came with the project:

/// <reference path="jquery-1.8.2.js" /> 

What is this reference notation? This is confusing - isn't this a comment that shouldn't do anything? As I understand it, double slash (//) comments on a string in JavaScript. Is there anything special about triple slash comments?

+4
source share
2 answers

see this article

http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx

and find the Help Directives

The help directive allows Visual Studio to establish a relationship between the script you are currently editing and other scripts. The help directive allows you to include a script file in the script context of the current script file. This allows IntelliSense to reference externally defined functions, types, and fields as they are encoded.

+4
source

This is a Triple Slash directive and has many uses.

See article

https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html

... Links to a triple slash instruct the compiler to include additional files in the compilation process ....

Very useful when linking typing definitions ... for example, typing mysql.d.ts has the following link to typical node.js characters ...

 ///<reference path='../node/node.d.ts' /> 
0
source

Source: https://habr.com/ru/post/910019/


All Articles