Skip to content

tripleSlashReferences

Reports triple-slash reference directives.

✅ This rule is included in the ts logical presets.

Triple-slash reference directives (/// <reference />) are an older TypeScript feature for declaring dependencies between files. With modern ECMAScript modules and tsconfig.json configuration, these directives are rarely needed.

This rule reports on uses of triple-slash references.

6F//CE6referenCB0paA1<1"sp ansty="le--0:#ECC48D;--1:#984E">4D./types.d.1<1"sp ansty="le--0:#7FDBCA;--1:#8844">AE d ivclassNa="meec-li">AEexport consB0valAE <= sp ansty="le--0:#F78C6C;--1:#AA09">8<21sp ansty="le--0:#D6DEEB;--1:#403F">5d><3;d ivclassNa="meco"><1;d>6F//CE6referenCB0typA1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dno1<1"sp ansty="le--0:#7FDBCA;--1:#8844">AE d ivclassNa="meec-li">AEconsB0paAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0requi5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dpa1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53d><);d ivclassNa="meco"><);d>
44AEim344AE3F53 { MyTyp44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4D./t1<111" spans="tyle--0:#D6DEEB;--1:#40">3c44AEexport co61B0v64<4AE spans="tyle--0:#FFCB8B;--1:#11">1111My44A0<9821 spans="tyle--0:#D6DEEB;--1:#40">3<= 1><;di vdivclass="Nameexpressive-">44AEim36<1B0* spans="tyle--0:#D6DEEB;--1:#40">3443F53 p44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4D1<111" spans="tyle--0:#D6DEEB;--1:#40">3

This rule is not configurable.

In some cases, triple-slash directives are still necessary:

  • When working with global type augmentations in a codebase not set up with tsconfig.json file inclusions
  • When a file needs to reference a specific declaration file that cannot be resolved through normal module resolution
  • When using /// <reference lib="..." /> for lib references in a codebase that overrides them

You might consider using Flint disable comments and/or configuration file disables for those specific situations instead of completely disabling this rule.