From 3746639b9def2acc52ebb3ff3f5f12e5dfaf0e7a Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 27 Jul 2024 13:54:03 +0700 Subject: [PATCH] feat!: @typescript-eslint/no-empty-object-type remove redundant `@typescript-eslint/no-empty-interface` Co-authored-by: Rostislav Simonik --- src/_intentionally-unused-rules.ts | 3 +++ src/index.ts | 8 ++++---- src/test/_expected-exported-value.ts | 8 ++++---- src/test/_rules_to_consider.ts | 1 - 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/_intentionally-unused-rules.ts b/src/_intentionally-unused-rules.ts index 4e334172..042c7f69 100644 --- a/src/_intentionally-unused-rules.ts +++ b/src/_intentionally-unused-rules.ts @@ -25,4 +25,7 @@ export const intentionallyUnusedRules: string[] = [ // Covered by strict TypeScript '@typescript-eslint/no-invalid-this', + + // Covered by `@typescript-eslint/no-empty-object-type` + '@typescript-eslint/no-empty-interface', ] diff --git a/src/index.ts b/src/index.ts index 630a55bb..7e4ed944 100644 --- a/src/index.ts +++ b/src/index.ts @@ -159,10 +159,6 @@ const rules = { allow: [], }, ], - '@typescript-eslint/no-empty-interface': [ - 'error', - { allowSingleExtends: true }, - ], '@typescript-eslint/no-explicit-any': [ 'error', { fixToUnknown: false, ignoreRestArgs: false }, @@ -172,6 +168,10 @@ const rules = { 'error', { allowWithDecorator: true }, ], + '@typescript-eslint/no-empty-object-type': [ + 'error', + { allowInterfaces: 'with-single-extends', allowObjectTypes: 'never' }, + ], '@typescript-eslint/no-floating-promises': ['error'], '@typescript-eslint/no-for-in-array': ['error'], '@typescript-eslint/no-implied-eval': ['error'], diff --git a/src/test/_expected-exported-value.ts b/src/test/_expected-exported-value.ts index d6db7d3c..9dc999c1 100644 --- a/src/test/_expected-exported-value.ts +++ b/src/test/_expected-exported-value.ts @@ -319,10 +319,6 @@ export const expectedExportedValue: TSESLint.FlatConfig.Config = { allow: [], }, ], - '@typescript-eslint/no-empty-interface': [ - 'error', - { allowSingleExtends: true }, - ], '@typescript-eslint/no-explicit-any': [ 'error', { fixToUnknown: false, ignoreRestArgs: false }, @@ -332,6 +328,10 @@ export const expectedExportedValue: TSESLint.FlatConfig.Config = { 'error', { allowWithDecorator: true }, ], + '@typescript-eslint/no-empty-object-type': [ + 'error', + { allowInterfaces: 'with-single-extends', allowObjectTypes: 'never' }, + ], '@typescript-eslint/no-floating-promises': ['error'], '@typescript-eslint/no-for-in-array': ['error'], '@typescript-eslint/no-implied-eval': ['error'], diff --git a/src/test/_rules_to_consider.ts b/src/test/_rules_to_consider.ts index 071447a6..9dc02965 100644 --- a/src/test/_rules_to_consider.ts +++ b/src/test/_rules_to_consider.ts @@ -1,5 +1,4 @@ export const rulesToConsider = [ - '@typescript-eslint/no-empty-object-type', '@typescript-eslint/no-inferrable-types', '@typescript-eslint/no-magic-numbers', '@typescript-eslint/no-meaningless-void-operator',