Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Latest commit

 

History

History
41 lines (26 loc) · 1.16 KB

no-triple-slash-reference.md

File metadata and controls

41 lines (26 loc) · 1.16 KB

Disallow /// <reference path="" /> comments (no-triple-slash-reference)

Triple-slash reference directive comments should not be used anymore. Use import instead.

Before TypeScript adopted ES6 Module syntax, triple-slash reference directives were used to specify dependencies. Now that we have import, triple-slash reference directives are discouraged for specifying dependencies in favor of import.

A triple-slash reference directive is a comment beginning with three slashes followed by a path to the module being imported: /// <reference path="./Animal" />. ES6 Modules handle this now: import animal from "./Animal"

Rule Details

Does not allow the use of /// <reference /> comments.

The following patterns are considered warnings:

/// <reference path="Animal">

The following patterns are not warnings:

import Animal from "Animal";

When Not To Use It

If you use /// <reference /> style imports.

Further Reading

Compatibility