|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Option. |
| 5 | + */ |
| 6 | +export type MatchDescriptionOption = { |
| 7 | + /** |
| 8 | + * If you wish to override the main function description without changing the default `match-description`, you may use `mainDescription`. |
| 9 | + * |
| 10 | + * @see [mainDescription](https://github.com/gajus/eslint-plugin-jsdoc#maindescription) |
| 11 | + */ |
| 12 | + mainDescription?: string; |
| 13 | + /** |
| 14 | + * You can supply your own expression to override the default, passing a `matchDescription` string on the options object. |
| 15 | + * |
| 16 | + * @see [matchDescription](https://github.com/gajus/eslint-plugin-jsdoc#matchdescription) |
| 17 | + */ |
| 18 | + matchDescription?: string; |
| 19 | + /** |
| 20 | + * Set this to an array of strings representing the AST context where you wish the rule to be applied (e.g., `ClassDeclaration` for ES6 classes). |
| 21 | + * |
| 22 | + * Overrides the default contexts (see below). Set to `"any"` if you want the rule to apply to any jsdoc block throughout your files. |
| 23 | + * |
| 24 | + * @see [contexts](https://github.com/gajus/eslint-plugin-jsdoc#contexts-1) |
| 25 | + */ |
| 26 | + contexts?: string[]; |
| 27 | + /** |
| 28 | + * If you want different regular expressions to apply to tags, you may use the `tags` option object. |
| 29 | + * |
| 30 | + * @see [tags](https://github.com/gajus/eslint-plugin-jsdoc#tags-2) |
| 31 | + */ |
| 32 | + tags?: Record<string, boolean>; |
| 33 | +}; |
| 34 | + |
| 35 | +/** |
| 36 | + * Options. |
| 37 | + */ |
| 38 | +export type MatchDescriptionOptions = [MatchDescriptionOption?]; |
| 39 | + |
| 40 | +/** |
| 41 | + * Enforces a regular expression pattern on descriptions. |
| 42 | + * |
| 43 | + * @see [match-description](https://github.com/gajus/eslint-plugin-jsdoc#match-description) |
| 44 | + */ |
| 45 | +export type MatchDescriptionRuleConfig = RuleConfig<MatchDescriptionOptions>; |
| 46 | + |
| 47 | +/** |
| 48 | + * Enforces a regular expression pattern on descriptions. |
| 49 | + * |
| 50 | + * @see [match-description](https://github.com/gajus/eslint-plugin-jsdoc#match-description) |
| 51 | + */ |
| 52 | +export interface MatchDescriptionRule { |
| 53 | + /** |
| 54 | + * Enforces a regular expression pattern on descriptions. |
| 55 | + * |
| 56 | + * @see [match-description](https://github.com/gajus/eslint-plugin-jsdoc#match-description) |
| 57 | + */ |
| 58 | + 'jsdoc/match-description': MatchDescriptionRuleConfig; |
| 59 | +} |
0 commit comments