From 634a80dd3e2af91bce9fc55c8bce9931832e0d71 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 17 Dec 2024 21:26:23 +1030 Subject: [PATCH 1/2] fix(typesript-eslint): export types so that declarations can be named for dts files --- packages/typescript-eslint/src/config-helper.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/typescript-eslint/src/config-helper.ts b/packages/typescript-eslint/src/config-helper.ts index 4fc3ee070c76..878dc8bca83e 100644 --- a/packages/typescript-eslint/src/config-helper.ts +++ b/packages/typescript-eslint/src/config-helper.ts @@ -66,6 +66,9 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config { extends?: InfiniteDepthConfigWithExtends[]; } +// exported so that users that make configs with tsconfig `declaration: true` can name the type +export type ConfigArray = TSESLint.FlatConfig.ConfigArray; + /** * Utility function to make it easy to strictly type your "Flat" config file * @example @@ -88,7 +91,7 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config { */ export function config( ...configs: InfiniteDepthConfigWithExtends[] -): TSESLint.FlatConfig.ConfigArray { +): ConfigArray { const flattened = // @ts-expect-error -- intentionally an infinite type configs.flat(Infinity) as ConfigWithExtends[]; From a0a8c9045ad56f306982e6175bde2bd57c620faf Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 17 Dec 2024 21:27:19 +1030 Subject: [PATCH 2/2] Update index.ts --- packages/typescript-eslint/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 470cb1055491..b96efd35d1e7 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -186,4 +186,9 @@ export default { }; export { configs, parser, plugin }; -export { config, type ConfigWithExtends } from './config-helper'; +export { + config, + type ConfigWithExtends, + type InfiniteDepthConfigWithExtends, + type ConfigArray, +} from './config-helper';