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