|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * As Needed Config. |
| 5 | + */ |
| 6 | +export interface QuotePropsAsNeededConfig { |
| 7 | + /** |
| 8 | + * Dis-/allows quotes around object literal property names that are not strictly required. |
| 9 | + * |
| 10 | + * @default true |
| 11 | + * |
| 12 | + * @see [unnecessary](https://eslint.org/docs/rules/quote-props#unnecessary) |
| 13 | + */ |
| 14 | + unnecessary?: boolean; |
| 15 | + /** |
| 16 | + * Requires quotes around numbers used as object property names. |
| 17 | + * |
| 18 | + * @default true |
| 19 | + * |
| 20 | + * @see [numbers](https://eslint.org/docs/rules/quote-props#numbers) |
| 21 | + */ |
| 22 | + numbers?: boolean; |
| 23 | +} |
| 24 | + |
| 25 | +/** |
| 26 | + * Consistent As Needed Config. |
| 27 | + */ |
| 28 | +export interface QuotePropsConsistentAsNeededConfig extends QuotePropsAsNeededConfig { |
| 29 | + /** |
| 30 | + * Requires quotes around language keywords used as object property names. |
| 31 | + * |
| 32 | + * @default true |
| 33 | + * |
| 34 | + * @see [keywords](https://eslint.org/docs/rules/quote-props#keywords) |
| 35 | + */ |
| 36 | + keywords?: boolean; |
| 37 | +} |
| 38 | + |
| 39 | +/** |
| 40 | + * Option. |
| 41 | + */ |
| 42 | +export type QuotePropsOption = 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed'; |
| 43 | + |
| 44 | +/** |
| 45 | + * Options. |
| 46 | + */ |
| 47 | +export type QuotePropsOptions = |
| 48 | + | [QuotePropsOption?] |
| 49 | + | ['as-needed'?, QuotePropsAsNeededConfig?] |
| 50 | + | ['consistent-as-needed'?, QuotePropsConsistentAsNeededConfig?]; |
| 51 | + |
| 52 | +/** |
| 53 | + * Require quotes around object literal property names. |
| 54 | + * |
| 55 | + * @see [quote-props](https://eslint.org/docs/rules/quote-props) |
| 56 | + */ |
| 57 | +export type QuotePropsRuleConfig = RuleConfig<QuotePropsOptions>; |
| 58 | + |
| 59 | +/** |
| 60 | + * Require quotes around object literal property names. |
| 61 | + * |
| 62 | + * @see [quote-props](https://eslint.org/docs/rules/quote-props) |
| 63 | + */ |
| 64 | +export interface QuotePropsRule { |
| 65 | + /** |
| 66 | + * Require quotes around object literal property names. |
| 67 | + * |
| 68 | + * @see [quote-props](https://eslint.org/docs/rules/quote-props) |
| 69 | + */ |
| 70 | + 'quote-props': QuotePropsRuleConfig; |
| 71 | +} |
0 commit comments