-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdznlint-configuration.ts
65 lines (59 loc) · 2.27 KB
/
dznlint-configuration.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
export type ConfigSeverity = "error" | "warning" | "hint";
export type ConfigValue = ConfigSeverity;
export type ConfigValueWithData<T> = [ConfigSeverity, T];
export interface DznLintFormatConfiguration {
indent: ["tabs" | "spaces", number];
braces: "same-line" | "next-line";
indent_components_interfaces: boolean;
target_width: number;
}
export interface DznLintConfiguration {
// Rule configuration
call_arguments_must_match: ConfigValue;
dead_code: ConfigValue;
implicit_illegal: ConfigValue;
inline_temporary_variables: ConfigValue;
invariant_must_be_bool: ConfigValue;
naming_convention: ConfigValueWithData<{
component: string;
enum: string;
enum_member: string;
interface: string;
local: string;
type: string;
}>;
never_fired_event: ConfigValue;
never_legal_event: ConfigValue;
no_bool_out_parameters: ConfigValue;
no_duplicate_parameters: ConfigValue;
no_duplicate_port_binding: ConfigValue;
no_empty_defer_capture: ConfigValue;
no_mismatching_binding_types: ConfigValue;
no_recursive_system: ConfigValue;
no_shadowing: ConfigValue;
no_unconnected_ports: ConfigValue;
no_unknown_imports: ConfigValue;
no_unknown_variables: ConfigValue;
no_unused_instances: ConfigValue;
no_unused_parameters: ConfigValue;
no_unused_ports: ConfigValue;
no_unused_variables: ConfigValue;
on_parameters_must_match: ConfigValue;
parameter_direction: ConfigValue;
port_missing_redundant_blocking: ConfigValue;
port_parameter_direction: ConfigValue;
}
export type UserRuleConfig<TRule extends keyof DznLintConfiguration> =
//false
//| ConfigValue
DznLintConfiguration[TRule] extends ConfigValueWithData<infer TData>
? Partial<TData> | [string, Partial<TData>]
: ConfigValue;
// Make all items optional, partial, and assignable with 'false' (to disable)
export type DznLintUserConfiguration = {
[P in keyof DznLintConfiguration]?: false | ConfigSeverity | DznLintConfiguration[P];
};
export type DznLintFormatUserConfiguration = {
[P in keyof DznLintFormatConfiguration]?: DznLintFormatConfiguration[P];
};
export type DznLintCombinedUserConfiguration = DznLintUserConfiguration & { format?: DznLintFormatConfiguration };