-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.ts
76 lines (71 loc) · 2.92 KB
/
options.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { type ImportOptions } from './rational-import.js';
import { type ImportSortOptions } from './rational-import-sort.js';
import { type PrettierOptions } from './rational-prettier.js';
import { type ReactOptions } from './rational-react.js';
import { type ReactHooksOptions } from './rational-react-hooks.js';
import { type RegexpOptions } from './rational-regexp.js';
import { type StylisticOptions } from './rational-stylistic.js';
import { type TypescriptOptions } from './rational-typescript.js';
import { type UnicornOptions } from './rational-unicorn.js';
/**
* Rational sharable config options.
*/
export interface Options {
/**
* Override for what file extensions are considered javascript files.
*/
jsExtensions?: `.${string}`[] | ((defaults: `.${string}`[]) => `.${string}`[]);
/**
* Override globa for which files are considered javascript files. Defaults
* to globs derived from `jsExtensions`.
*/
jsFiles?: string[] | ((defaults: string[]) => string[]);
/**
* Override globs for which files are considered javascript _development_
* files. Development files are things like test and configuration files.
* Rules can generally be slightly relaxed for these files. Defaults to globs
* derived from `jsExtensions`.
*/
jsDevFiles?: string[] | ((defaults: string[]) => string[]);
/**
* Override for what file extensions are considered typescript files.
*/
tsExtensions?: `.${string}`[] | ((defaults: `.${string}`[]) => `.${string}`[]);
/**
* Override globs for which files are considered typescript files. Defaults
* to globs derived from `tsExtensions`.
*/
tsFiles?: string[] | ((defaults: string[]) => string[]);
/**
* Override globs for which files are considered typescript _development_
* files. Development files are things like test and configuration files.
* Rules can generally be slightly relaxed for these files. Defaults to globs
* derived from `tsExtensions`.
*/
tsDevFiles?: string[] | ((defaults: string[]) => string[]);
/**
* Override for what file extensions are considered react files. Defaults to
* globs derived from `jsExtensions` and `tsExtensions` where the extension
* ends with an `x`
*/
reactExtensions?: `.${string}`[] | ((defaults: `.${string}`[]) => `.${string}`[]);
/**
* Override globs for which files are considered react files. Defaults to
* globs derived from `reactExtensions`.
*/
reactFiles?: string[] | ((defaults: string[]) => string[]);
/**
* Disable or enable plugins. All plugins are enabled by default.
*/
plugins?: {
import?: boolean | ImportOptions;
importSort?: boolean | ImportSortOptions;
react?: boolean | ReactOptions;
reactHooks?: boolean | ReactHooksOptions;
regexp?: boolean | RegexpOptions;
stylistic?: boolean | StylisticOptions;
typescript?: boolean | TypescriptOptions;
unicorn?: boolean | UnicornOptions;
prettier?: boolean | PrettierOptions;
};
}