@@ -129,6 +129,11 @@ export interface RulesMetaDocs {
129
129
* Indicates if the rule is generally recommended for all users.
130
130
*/
131
131
recommended ?: boolean | undefined ;
132
+
133
+ /**
134
+ * Indicates if the rule is frozen (no longer accepting feature requests).
135
+ */
136
+ frozen ?: boolean | undefined ;
132
137
}
133
138
134
139
/**
@@ -159,12 +164,13 @@ export interface RulesMeta<
159
164
messages ?: Record < MessageIds , string > ;
160
165
161
166
/**
162
- * The deprecated rules for the rule .
167
+ * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated .
163
168
*/
164
- deprecated ?: boolean | undefined ;
169
+ deprecated ?: boolean | DeprecatedInfo | undefined ;
165
170
166
171
/**
167
- * When a rule is deprecated, indicates the rule ID(s) that should be used instead.
172
+ * @deprecated Use deprecated.replacedBy instead.
173
+ * The name of the rule(s) this rule was replaced by, if it was deprecated.
168
174
*/
169
175
replacedBy ?: readonly string [ ] | undefined ;
170
176
@@ -179,6 +185,82 @@ export interface RulesMeta<
179
185
hasSuggestions ?: boolean | undefined ;
180
186
}
181
187
188
+ /**
189
+ * Provides additional metadata about a deprecation.
190
+ */
191
+ export interface DeprecatedInfo {
192
+ /**
193
+ * General message presented to the user, e.g. for the key rule why the rule
194
+ * is deprecated or for info how to replace the rule.
195
+ */
196
+ message ?: string ;
197
+
198
+ /**
199
+ * URL to more information about this deprecation in general.
200
+ */
201
+ url ?: string ;
202
+
203
+ /**
204
+ * An empty array explicitly states that there is no replacement.
205
+ */
206
+ replacedBy ?: ReplacedByInfo [ ] ;
207
+
208
+ /**
209
+ * The package version since when the rule is deprecated (should use full
210
+ * semver without a leading "v").
211
+ */
212
+ deprecatedSince ?: string ;
213
+
214
+ /**
215
+ * The estimated version when the rule is removed (probably the next major
216
+ * version). null means the rule is "frozen" (will be available but will not
217
+ * be changed).
218
+ */
219
+ availableUntil ?: string | null ;
220
+ }
221
+
222
+ /**
223
+ * Provides metadata about a replacement
224
+ */
225
+ export interface ReplacedByInfo {
226
+ /**
227
+ * General message presented to the user, e.g. how to replace the rule
228
+ */
229
+ message ?: string ;
230
+
231
+ /**
232
+ * URL to more information about this replacement in general
233
+ */
234
+ url ?: string ;
235
+
236
+ /**
237
+ * Name should be "eslint" if the replacement is an ESLint core rule. Omit
238
+ * the property if the replacement is in the same plugin.
239
+ */
240
+ plugin ?: ExternalSpecifier ;
241
+
242
+ /**
243
+ * Name and documentation of the replacement rule
244
+ */
245
+ rule ?: ExternalSpecifier ;
246
+ }
247
+
248
+ /**
249
+ * Specifies the name and url of an external resource. At least one property
250
+ * should be set.
251
+ */
252
+ export interface ExternalSpecifier {
253
+ /**
254
+ * Name of the referenced plugin / rule.
255
+ */
256
+ name ?: string ;
257
+
258
+ /**
259
+ * URL pointing to documentation for the plugin / rule.
260
+ */
261
+ url ?: string ;
262
+ }
263
+
182
264
/**
183
265
* Generic type for `RuleContext`.
184
266
*/
0 commit comments