|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Option. |
| 5 | + */ |
| 6 | +export type NoUnusedExpressionsOption = { |
| 7 | + /** |
| 8 | + * Set to `true` will allow you to use short circuit evaluations in your expressions. |
| 9 | + * |
| 10 | + * @default false |
| 11 | + * |
| 12 | + * @see [allowShortCircuit](https://eslint.org/docs/rules/no-unused-expressions#allowshortcircuit) |
| 13 | + */ |
| 14 | + allowShortCircuit?: boolean; |
| 15 | + /** |
| 16 | + * Set to `true` will enable you to use ternary operators in your expressions similarly to short circuit evaluations. |
| 17 | + * |
| 18 | + * @default false |
| 19 | + * |
| 20 | + * @see [allowTernary](https://eslint.org/docs/rules/no-unused-expressions#allowternary) |
| 21 | + */ |
| 22 | + allowTernary?: boolean; |
| 23 | + /** |
| 24 | + * Set to `true` will enable you to use tagged template literals in your expressions. |
| 25 | + * |
| 26 | + * @default false |
| 27 | + * |
| 28 | + * @see [allowTaggedTemplates](https://eslint.org/docs/rules/no-unused-expressions#allowtaggedtemplates) |
| 29 | + */ |
| 30 | + allowTaggedTemplates?: boolean; |
| 31 | + /** |
| 32 | + * Set to `true` will flag unused JSX element expressions. |
| 33 | + * |
| 34 | + * @default false |
| 35 | + * |
| 36 | + * @see [enforceForJSX](https://eslint.org/docs/rules/no-unused-expressions#enforceforjsx) |
| 37 | + */ |
| 38 | + enforceForJSX?: boolean; |
| 39 | +}; |
| 40 | + |
| 41 | +/** |
| 42 | + * Options. |
| 43 | + */ |
| 44 | +export type NoUnusedExpressionsOptions = [NoUnusedExpressionsOption?]; |
| 45 | + |
| 46 | +/** |
| 47 | + * Disallow unused expressions. |
| 48 | + * |
| 49 | + * @see [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions) |
| 50 | + */ |
| 51 | +export type NoUnusedExpressionsRuleConfig = RuleConfig<NoUnusedExpressionsOptions>; |
| 52 | + |
| 53 | +/** |
| 54 | + * Disallow unused expressions. |
| 55 | + * |
| 56 | + * @see [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions) |
| 57 | + */ |
| 58 | +export interface NoUnusedExpressionsRule { |
| 59 | + /** |
| 60 | + * Disallow unused expressions. |
| 61 | + * |
| 62 | + * @see [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions) |
| 63 | + */ |
| 64 | + 'no-unused-expressions': NoUnusedExpressionsRuleConfig; |
| 65 | +} |
0 commit comments