-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathtypes.ts
37 lines (33 loc) · 972 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { TSESLint } from '@typescript-eslint/utils';
type Recommended = 'error' | 'warn' | false;
type RecommendedConfig<TOptions extends readonly unknown[]> =
| Recommended
| [Recommended, ...TOptions];
export type TestingLibraryPluginDocs<TOptions extends readonly unknown[]> = {
/**
* The recommendation level for the rule on a framework basis.
* Used by the build tools to generate the framework config.
* Set to `false` to not include it the config
*/
recommendedConfig: Record<
SupportedTestingFramework,
RecommendedConfig<TOptions>
>;
};
export type TestingLibraryPluginRuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
> = TSESLint.RuleModuleWithMetaDocs<
TMessageIds,
TOptions,
TestingLibraryPluginDocs<TOptions>
>;
export const SUPPORTED_TESTING_FRAMEWORKS = [
'dom',
'angular',
'react',
'vue',
'marko',
] as const;
export type SupportedTestingFramework =
(typeof SUPPORTED_TESTING_FRAMEWORKS)[number];