triple-slash-reference
Added in v0.1.14Configuration
rslint.config.ts
Rule Details
Disallow certain triple slash directives in favor of ES6-style import declarations. TypeScript's /// <reference ... /> triple-slash directives are an older mechanism for including type information. In most modern codebases, ES6-style import statements are preferred. This rule can ban /// <reference path="..." />, /// <reference types="..." />, and /// <reference lib="..." /> directives.
The default options are:
lib: "always": allowlibreferences.path: "never": disallowpathreferences.types: "prefer-import": disallow atypesreference only when the same module is also imported.
Examples of incorrect code for this rule:
Examples of correct code for this rule: