|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Option. |
| 5 | + */ |
| 6 | +export type RestrictTemplateExpressionsOption = { |
| 7 | + /** |
| 8 | + * If `true`, also allow number type in template expressions. |
| 9 | + * |
| 10 | + * @default true |
| 11 | + * |
| 12 | + * @see [allowNumber](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md#allownumber) |
| 13 | + */ |
| 14 | + allowNumber?: boolean; |
| 15 | + /** |
| 16 | + * If `true`, also allow boolean type in template expressions. |
| 17 | + * |
| 18 | + * @default false |
| 19 | + * |
| 20 | + * @see [allowBoolean](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md#allowboolean) |
| 21 | + */ |
| 22 | + allowBoolean?: boolean; |
| 23 | + /** |
| 24 | + * If `true`, also allow any in template expressions. |
| 25 | + * |
| 26 | + * @default false |
| 27 | + * |
| 28 | + * @see [allowAny](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md#allowany) |
| 29 | + */ |
| 30 | + allowAny?: boolean; |
| 31 | + /** |
| 32 | + * If `true`, also allow null and undefined in template expressions. |
| 33 | + * |
| 34 | + * @default false |
| 35 | + * |
| 36 | + * @see [allowNullish](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md#allownullish) |
| 37 | + */ |
| 38 | + allowNullish?: boolean; |
| 39 | +}; |
| 40 | + |
| 41 | +/** |
| 42 | + * Options. |
| 43 | + */ |
| 44 | +export type RestrictTemplateExpressionsOptions = [RestrictTemplateExpressionsOption?]; |
| 45 | + |
| 46 | +/** |
| 47 | + * Enforce template literal expressions to be of string type. |
| 48 | + * |
| 49 | + * @see [restrict-template-expressions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md) |
| 50 | + */ |
| 51 | +export type RestrictTemplateExpressionsRuleConfig = RuleConfig<RestrictTemplateExpressionsOptions>; |
| 52 | + |
| 53 | +/** |
| 54 | + * Enforce template literal expressions to be of string type. |
| 55 | + * |
| 56 | + * @see [restrict-template-expressions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md) |
| 57 | + */ |
| 58 | +export interface RestrictTemplateExpressionsRule { |
| 59 | + /** |
| 60 | + * Enforce template literal expressions to be of string type. |
| 61 | + * |
| 62 | + * @see [restrict-template-expressions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md) |
| 63 | + */ |
| 64 | + '@typescript-eslint/restrict-template-expressions': RestrictTemplateExpressionsRuleConfig; |
| 65 | +} |
0 commit comments