Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-reference with type definition files #1562

Closed
DataTables opened this issue Sep 20, 2016 · 2 comments
Closed

no-reference with type definition files #1562

DataTables opened this issue Sep 20, 2016 · 2 comments

Comments

@DataTables
Copy link

Bug Report

  • TSLint version: 3.15.1
  • TypeScript version: 2.0.0 beta
  • Running TSLint via: Sublime Linter

TypeScript code being linted

/// <reference path="../types/node.d.ts" />

with tslint.json configuration:

{
  "no-reference": true
}

Actual behavior

Reference not allowed warning.

Expected behavior

Because this is a type definition file my understanding is that a reference is [still the way to import it](microsoft/TypeScript#2242 (comment) rather than with ES6 modules. As a result the <reference is valid in this use case with no ES6 alternative.

I wonder if it would be appropriate to allow the rule to allow type definition files?

@jkillian
Copy link
Contributor

@DataTables better in this situation to just add your typings files to your list of files via your tsconfig.json file. Then you don't have to include comments like that anywhere in your source files.

Perhaps that should be better explained in the documentation though?

@DataTables
Copy link
Author

Including that in the documentation sounds good to me - thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants