@ttsc/lint 0.25.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/index.js +62 -2
- package/lib/index.js.map +1 -1
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +73 -16
- package/linthost/config_format.go +7 -0
- package/linthost/directives.go +4 -7
- package/linthost/fix.go +6 -4
- package/linthost/rule_codes.json +1 -0
- package/linthost/rules_format_brace_continuation.go +267 -0
- package/linthost/rules_format_clause_join.go +289 -40
- package/linthost/rules_format_parameter_properties.go +9 -21
- package/linthost/rules_format_whitespace.go +5 -1
- package/linthost/rules_functional.go +248 -25
- package/linthost/rules_ts_extra.go +7 -5
- package/package.json +2 -2
- package/rule/rule.go +21 -9
- package/src/index.ts +70 -2
- package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +73 -16
|
@@ -80,24 +80,45 @@ export interface ITtscLintFunctionalNoThrowStatementsRuleOptions {
|
|
|
80
80
|
|
|
81
81
|
/** `functional/no-mixed-types` rule options. */
|
|
82
82
|
export interface ITtscLintFunctionalNoMixedTypesRuleOptions {
|
|
83
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Check interface member kinds.
|
|
85
|
+
*
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
84
88
|
checkInterfaces?: boolean;
|
|
85
89
|
|
|
86
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Check type-literal member kinds.
|
|
92
|
+
*
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
87
95
|
checkTypeLiterals?: boolean;
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
/** `functional/no-return-void` rule options. */
|
|
91
99
|
export interface ITtscLintFunctionalNoReturnVoidRuleOptions {
|
|
92
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Permit a function whose declared return type is `null`. Set `false` to
|
|
102
|
+
* reject it the way a declared `void` is rejected.
|
|
103
|
+
*
|
|
104
|
+
* @default true
|
|
105
|
+
*/
|
|
93
106
|
allowNull?: boolean;
|
|
94
107
|
|
|
95
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Permit a function whose declared return type is `undefined`. Set `false` to
|
|
110
|
+
* reject it the way a declared `void` is rejected.
|
|
111
|
+
*
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
96
114
|
allowUndefined?: boolean;
|
|
97
115
|
|
|
98
116
|
/**
|
|
99
|
-
* Skip
|
|
100
|
-
*
|
|
117
|
+
* Skip a bare `return;` inside a function that declares no return type. That
|
|
118
|
+
* statement is the one place the rule rejects a void-ness it inferred rather
|
|
119
|
+
* than read from an annotation.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
101
122
|
*/
|
|
102
123
|
ignoreInferredTypes?: boolean;
|
|
103
124
|
}
|
|
@@ -105,7 +126,8 @@ export interface ITtscLintFunctionalNoReturnVoidRuleOptions {
|
|
|
105
126
|
/** `functional/prefer-immutable-types` rule options. */
|
|
106
127
|
export interface ITtscLintFunctionalPreferImmutableTypesRuleOptions extends ITtscLintFunctionalPatternOptions {
|
|
107
128
|
/**
|
|
108
|
-
* Minimum accepted immutability.
|
|
129
|
+
* Minimum accepted immutability. Reserved for upstream-compatible configs;
|
|
130
|
+
* the native subset computes no immutability level and treats any configured
|
|
109
131
|
* value as readonly-required.
|
|
110
132
|
*/
|
|
111
133
|
enforcement?:
|
|
@@ -118,31 +140,62 @@ export interface ITtscLintFunctionalPreferImmutableTypesRuleOptions extends ITts
|
|
|
118
140
|
|
|
119
141
|
/** `functional/prefer-readonly-type` rule options. */
|
|
120
142
|
export interface ITtscLintFunctionalPreferReadonlyTypeRuleOptions extends ITtscLintFunctionalPatternOptions {
|
|
121
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Permit mutation of locals while still policing exported types. Reserved for
|
|
145
|
+
* upstream-compatible configs; the native subset reads type annotations and
|
|
146
|
+
* models no local-versus-exported distinction.
|
|
147
|
+
*/
|
|
122
148
|
allowLocalMutation?: boolean;
|
|
123
149
|
|
|
124
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Permit a mutable return type even when parameters must be readonly. Covers
|
|
152
|
+
* every signature that can declare one, including call and construct
|
|
153
|
+
* signatures, constructor types, and a get accessor.
|
|
154
|
+
*
|
|
155
|
+
* @default false
|
|
156
|
+
*/
|
|
125
157
|
allowMutableReturnType?: boolean;
|
|
126
158
|
|
|
127
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Also check property positions that have no explicit type annotation.
|
|
161
|
+
* Reserved for upstream-compatible configs; judging an unannotated position
|
|
162
|
+
* needs the type checker, which this rule does not use.
|
|
163
|
+
*/
|
|
128
164
|
checkImplicit?: boolean;
|
|
129
165
|
|
|
130
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Skip array / tuple / `Map` / `Set` types.
|
|
168
|
+
*
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
131
171
|
ignoreCollections?: boolean;
|
|
132
172
|
|
|
133
173
|
/**
|
|
134
|
-
* Skip class
|
|
135
|
-
*
|
|
174
|
+
* Skip class members. `true` skips anything under a class, its heritage
|
|
175
|
+
* clause and type parameters included; `"fieldsOnly"` narrows that to field
|
|
176
|
+
* declarations and keeps methods, accessors, and constructor parameters
|
|
177
|
+
* checked.
|
|
178
|
+
*
|
|
179
|
+
* @default false
|
|
136
180
|
*/
|
|
137
181
|
ignoreClass?: boolean | "fieldsOnly";
|
|
138
182
|
|
|
139
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Skip interface members entirely.
|
|
185
|
+
*
|
|
186
|
+
* @default false
|
|
187
|
+
*/
|
|
140
188
|
ignoreInterface?: boolean;
|
|
141
189
|
}
|
|
142
190
|
|
|
143
191
|
/** `functional/prefer-tacit` rule options. */
|
|
144
192
|
export interface ITtscLintFunctionalPreferTacitRuleOptions {
|
|
145
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* Check member expressions such as `x => service.map(x)`. Set `false` to keep
|
|
195
|
+
* the rule on bare-identifier callees only.
|
|
196
|
+
*
|
|
197
|
+
* @default true
|
|
198
|
+
*/
|
|
146
199
|
checkMemberExpressions?: boolean;
|
|
147
200
|
}
|
|
148
201
|
|
|
@@ -167,7 +220,11 @@ export interface ITtscLintFunctionalTypeDeclarationImmutabilityRule {
|
|
|
167
220
|
*/
|
|
168
221
|
immutability?: "ReadonlyShallow" | "ReadonlyDeep" | "Immutable" | "Mutable";
|
|
169
222
|
|
|
170
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* Comparator applied to the immutability level above. Reserved for
|
|
225
|
+
* upstream-compatible configs alongside `immutability`: the native subset
|
|
226
|
+
* computes no immutability level, so there is nothing to compare.
|
|
227
|
+
*/
|
|
171
228
|
comparator?:
|
|
172
229
|
| "Less"
|
|
173
230
|
| "AtMost"
|