@@ -35,8 +35,8 @@ const { hasOwn } = Object,
3535// `describe` and `it` functions
3636// ------------------------------------------------------------------------------
3737
38- export type DescribeFn = ( text : string , fn : ( ) => void ) => void ;
39- export type ItFn = ( ( text : string , fn : ( ) => void ) => void ) & { only ?: ItFn } ;
38+ type DescribeFn = ( text : string , fn : ( ) => void ) => void ;
39+ type ItFn = ( ( text : string , fn : ( ) => void ) => void ) & { only ?: ItFn } ;
4040
4141/**
4242 * Default `describe` function, if `describe` doesn't exist as a global.
@@ -111,7 +111,7 @@ function getItOnly(): ItFn {
111111/**
112112 * Configuration for `RuleTester`.
113113 */
114- export interface Config {
114+ interface Config {
115115 /**
116116 * ESLint compatibility mode.
117117 * If `true`, column offsets in diagnostics are incremented by 1, to match ESLint's behavior.
@@ -154,12 +154,12 @@ interface TestCase {
154154/**
155155 * Test case for valid code.
156156 */
157- export interface ValidTestCase extends TestCase { }
157+ interface ValidTestCase extends TestCase { }
158158
159159/**
160160 * Test case for invalid code.
161161 */
162- export interface InvalidTestCase extends TestCase {
162+ interface InvalidTestCase extends TestCase {
163163 output ?: string | null ;
164164 errors : number | ErrorEntry [ ] ;
165165}
@@ -169,7 +169,7 @@ type ErrorEntry = Error | string | RegExp;
169169/**
170170 * Expected error.
171171 */
172- export type Error = RequireAtLeastOne < ErrorBase , "message" | "messageId" > ;
172+ type Error = RequireAtLeastOne < ErrorBase , "message" | "messageId" > ;
173173
174174interface ErrorBase {
175175 message ?: string | RegExp ;
@@ -184,7 +184,7 @@ interface ErrorBase {
184184/**
185185 * Test cases for a rule.
186186 */
187- export interface TestCases {
187+ interface TestCases {
188188 valid : ( ValidTestCase | string ) [ ] ;
189189 invalid : InvalidTestCase [ ] ;
190190}
@@ -990,3 +990,22 @@ function isSerializablePrimitiveOrPlainObject(value: unknown): boolean {
990990 ( typeof value === "object" && ( value . constructor === Object || isArray ( value ) ) )
991991 ) ;
992992}
993+
994+ // Add types to `RuleTester` namespace
995+ type _Config = Config ;
996+ type _DescribeFn = DescribeFn ;
997+ type _ItFn = ItFn ;
998+ type _ValidTestCase = ValidTestCase ;
999+ type _InvalidTestCase = InvalidTestCase ;
1000+ type _TestCases = TestCases ;
1001+ type _Error = Error ;
1002+
1003+ export namespace RuleTester {
1004+ export type Config = _Config ;
1005+ export type DescribeFn = _DescribeFn ;
1006+ export type ItFn = _ItFn ;
1007+ export type ValidTestCase = _ValidTestCase ;
1008+ export type InvalidTestCase = _InvalidTestCase ;
1009+ export type TestCases = _TestCases ;
1010+ export type Error = _Error ;
1011+ }
0 commit comments