-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added docs for no-reference-import
- Loading branch information
Jesse Trinity
committed
Jun 18, 2019
1 parent
b4726d3
commit e0ee130
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Disallow simultaneous use of `/// <reference type="" />` comments and ES6 style imports for the same module. (no-reference-import) | ||
|
||
Use of triple-slash directives is discouraged in favor of the newer `import` style. In cases where both styles might occur, this rule prevents use of triple-slash references for modules which are otherwise imported. | ||
|
||
Use `no-triple-slash-reference` instead if you intend to ban triple slash directives entirely. | ||
|
||
## Rule Details | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```ts | ||
/// <reference types="foo" /> | ||
import * as foo from 'foo'; | ||
``` | ||
|
||
```ts | ||
/// <reference types="foo" /> | ||
import foo = require('foo'); | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```ts | ||
import * as foo from 'foo'; | ||
``` | ||
|
||
```ts | ||
import foo = require('foo'); | ||
``` | ||
|
||
## When To Use It | ||
|
||
Any time you might use triple-slash directives and ES6 import declarations in the same file. | ||
|
||
## When Not To Use It | ||
|
||
If you intend to ban triple slash directives entirely. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters