From 52f0a2b8da1d7db8652ea4a9ab6cc233309fd2f1 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 6 Mar 2021 16:10:16 +0100 Subject: [PATCH] docs(eslint-plugin): correct no longer valid references and examples --- .../eslint-plugin/docs/rules/consistent-type-imports.md | 2 +- packages/eslint-plugin/docs/rules/no-magic-numbers.md | 8 ++++---- .../eslint-plugin/docs/rules/triple-slash-reference.md | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/consistent-type-imports.md b/packages/eslint-plugin/docs/rules/consistent-type-imports.md index c30e59b40b99..a5808b455788 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-imports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-imports.md @@ -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.
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. diff --git a/packages/eslint-plugin/docs/rules/no-magic-numbers.md b/packages/eslint-plugin/docs/rules/no-magic-numbers.md index f41204c132bf..8149ad6ddd6b 100644 --- a/packages/eslint-plugin/docs/rules/no-magic-numbers.md +++ b/packages/eslint-plugin/docs/rules/no-magic-numbers.md @@ -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, } ``` @@ -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, } ``` diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md index af9e5498b6d4..9eb463a3c790 100644 --- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md +++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -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 `/// `, `/// `, or `/// ` 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: