From 3144a6f847f65902a3dd11ee34a077c30b4a23da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Wed, 20 Nov 2024 17:14:50 +0100 Subject: [PATCH 1/2] feat: cleanup main types --- index.d.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/index.d.ts b/index.d.ts index bbd18c78e..c0b73da0f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,6 @@ -import type { Linter, Rule } from 'eslint'; +import type { TSESLint } from '@typescript-eslint/utils'; + +type SupportedConfigs = 'all' | 'recommended' | 'style'; declare const plugin: { meta: { @@ -7,22 +9,12 @@ declare const plugin: { }; environments: { globals: { - globals: { - [key: string]: boolean; - }; + globals: Record; }; }; - configs: { - all: Linter.LegacyConfig; - recommended: Linter.LegacyConfig; - style: Linter.LegacyConfig; - 'flat/all': Linter.FlatConfig; - 'flat/recommended': Linter.FlatConfig; - 'flat/style': Linter.FlatConfig; - }; - rules: { - [key: string]: Rule.RuleModule; - }; + configs: Record & + Record<`flat/${SupportedConfigs}`, TSESLint.FlatConfig>; + rules: Record; }; export = plugin; From 0d18463d0981dda405c9f7d3a9794a44a5e1347e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Wed, 20 Nov 2024 17:25:13 +0100 Subject: [PATCH 2/2] Update index.d.ts --- index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index c0b73da0f..a2d455566 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,6 @@ import type { TSESLint } from '@typescript-eslint/utils'; -type SupportedConfigs = 'all' | 'recommended' | 'style'; +type JestPluginConfigName = 'all' | 'recommended' | 'style'; declare const plugin: { meta: { @@ -12,8 +12,8 @@ declare const plugin: { globals: Record; }; }; - configs: Record & - Record<`flat/${SupportedConfigs}`, TSESLint.FlatConfig>; + configs: Record & + Record<`flat/${JestPluginConfigName}`, TSESLint.FlatConfig>; rules: Record; };