Skip to content

docs(eslint-plugin): correct no longer valid references and examples #3152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ const x: import('Bar') = 1;
## When Not To Use It

- If you are not using TypeScript 3.8 (or greater), then you will not be able to use this rule, as type-only imports are not allowed.
- Certain libraries use the non-inlined imports to infer information about the variables. For example, for dependency injection.
- Certain libraries use the non-inlined imports to infer information about the variables. For example, for dependency injection.<br/>
type-only imports cannot be used with these libraries. See [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559#issuecomment-692780580)
- If you specifically want to use both import kinds for stylistic reasons, you can disable this rule.
8 changes: 4 additions & 4 deletions packages/eslint-plugin/docs/rules/no-magic-numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Examples of **incorrect** code for the `{ "ignoreEnums": false }` option:
```ts
/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreEnums": false }]*/

enum foo = {
SECOND = 1000,
enum foo {
SECOND = 1000,
}
```

Expand All @@ -63,8 +63,8 @@ Examples of **correct** code for the `{ "ignoreEnums": true }` option:
```ts
/*eslint @typescript-eslint/no-magic-numbers: ["error", { "ignoreEnums": true }]*/

enum foo = {
SECOND = 1000,
enum foo {
SECOND = 1000,
}
```

Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/docs/rules/triple-slash-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Use of triple-slash reference type directives is discouraged in favor of the newer `import` style. This rule allows you to ban use of `/// <reference path="" />`, `/// <reference types="" />`, or `/// <reference lib="" />` directives.

Consider using this rule in place of [`no-triple-slash-reference`](./no-triple-slash-reference.md) which has been deprecated.

## Rule Details

With `{ "path": "never", "types": "never", "lib": "never" }` options set, the following will all be **incorrect** usage:
Expand Down