@@ -248,6 +248,37 @@ type Options = {
248
248
ReadonlyDeep? : Array <Array <{ pattern: string ; replace: string }>>;
249
249
Immutable? : Array <Array <{ pattern: string ; replace: string }>>;
250
250
};
251
+
252
+ overrides? : Array <{
253
+ match: Array <
254
+ | {
255
+ from: " file" ;
256
+ path? : string ;
257
+ name? : string | string [];
258
+ pattern? : RegExp | RegExp [];
259
+ ignoreName? : string | string [];
260
+ ignorePattern? : RegExp | RegExp [];
261
+ }
262
+ | {
263
+ from: " lib" ;
264
+ name? : string | string [];
265
+ pattern? : RegExp | RegExp [];
266
+ ignoreName? : string | string [];
267
+ ignorePattern? : RegExp | RegExp [];
268
+ }
269
+ | {
270
+ from: " package" ;
271
+ package? : string ;
272
+ name? : string | string [];
273
+ pattern? : RegExp | RegExp [];
274
+ ignoreName? : string | string [];
275
+ ignorePattern? : RegExp | RegExp [];
276
+ }
277
+ >;
278
+ options: Omit <Options , " overrides" >;
279
+ inherit? : boolean ;
280
+ disable: boolean ;
281
+ }>;
251
282
};
252
283
```
253
284
@@ -482,3 +513,29 @@ It allows for the ability to ignore violations based on the identifier (name) of
482
513
483
514
This option takes a ` RegExp ` string or an array of ` RegExp ` strings.
484
515
It allows for the ability to ignore violations based on the type (as written, with whitespace removed) of the node in question.
516
+
517
+ ### ` overrides `
518
+
519
+ Allows for applying overrides to the options based on the type's declaration.
520
+ This can be used to override the settings for types coming from 3rd party libraries.
521
+
522
+ Note: Only the first matching override will be used.
523
+
524
+ #### ` overrides[n].specifiers `
525
+
526
+ A specifier, or an array of specifiers to match the function type against.
527
+
528
+ In the case of reference types, both the type and its generics will be recursively checked.
529
+ If any of them match, the specifier will be considered a match.
530
+
531
+ #### ` overrides[n].options `
532
+
533
+ The options to use when a specifiers matches.
534
+
535
+ #### ` overrides[n].inherit `
536
+
537
+ Inherit the root options? Default is ` true ` .
538
+
539
+ #### ` overrides[n].disable `
540
+
541
+ If true, when a specifier matches, this rule will not be applied to the matching node.
0 commit comments