Skip to content

Commit d24a828

Browse files
authored
fix(typescript-eslint): export types so that declarations can be named for dts files (#10513)
* fix(typesript-eslint): export types so that declarations can be named for dts files * Update index.ts
1 parent b2ce158 commit d24a828

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/typescript-eslint/src/config-helper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config {
6666
extends?: InfiniteDepthConfigWithExtends[];
6767
}
6868

69+
// exported so that users that make configs with tsconfig `declaration: true` can name the type
70+
export type ConfigArray = TSESLint.FlatConfig.ConfigArray;
71+
6972
/**
7073
* Utility function to make it easy to strictly type your "Flat" config file
7174
* @example
@@ -88,7 +91,7 @@ export interface ConfigWithExtends extends TSESLint.FlatConfig.Config {
8891
*/
8992
export function config(
9093
...configs: InfiniteDepthConfigWithExtends[]
91-
): TSESLint.FlatConfig.ConfigArray {
94+
): ConfigArray {
9295
const flattened =
9396
// @ts-expect-error -- intentionally an infinite type
9497
configs.flat(Infinity) as ConfigWithExtends[];

packages/typescript-eslint/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,9 @@ export default {
186186
};
187187
export { configs, parser, plugin };
188188

189-
export { config, type ConfigWithExtends } from './config-helper';
189+
export {
190+
config,
191+
type ConfigWithExtends,
192+
type InfiniteDepthConfigWithExtends,
193+
type ConfigArray,
194+
} from './config-helper';

0 commit comments

Comments
 (0)