Skip to content

Commit

Permalink
feat(eslint-plugin): deprecate no-duplicate-imports in favour of `i…
Browse files Browse the repository at this point in the history
…mport/no-duplicates` (#4973)
  • Loading branch information
snewcomer committed May 16, 2022
1 parent 13c05ae commit 1d2e41a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/eslint-plugin/README.md
Expand Up @@ -209,7 +209,6 @@ In these cases, we create what we call an extension rule; a rule within our plug
| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | |
| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :white_check_mark: | :wrench: | |
| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | |
| [`@typescript-eslint/no-duplicate-imports`](./docs/rules/no-duplicate-imports.md) | Disallow duplicate imports | | | |
| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :white_check_mark: | | |
| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | |
| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :white_check_mark: | :wrench: | |
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-plugin/docs/rules/no-duplicate-imports.md
Expand Up @@ -2,6 +2,10 @@

Disallow duplicate imports.

## DEPRECATED

This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule.

## Rule Details

This rule extends the base [`eslint/no-duplicate-imports`](https://eslint.org/docs/rules/no-duplicate-imports) rule.
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
Expand Up @@ -8,6 +8,8 @@ By default, TypeScript will type a catch clause variable as `any`, so explicitly

The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons, however you can use `useUnknownInCatchVariables` (part of `strict`) instead of this rule.

## DEPRECATED

## Rule Details

This rule requires an explicit type to be declared on a catch clause variable.
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/configs/all.ts
Expand Up @@ -53,7 +53,6 @@ export = {
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'no-duplicate-imports': 'off',
'@typescript-eslint/no-duplicate-imports': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/src/rules/no-duplicate-imports.ts
Expand Up @@ -10,6 +10,8 @@ type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
export default util.createRule<Options, MessageIds>({
name: 'no-duplicate-imports',
meta: {
deprecated: true,
replacedBy: ['import/no-duplicates'],
type: 'problem',
docs: {
description: 'Disallow duplicate imports',
Expand Down

0 comments on commit 1d2e41a

Please sign in to comment.