|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Indent Config. |
| 5 | + */ |
| 6 | +export interface IndentConfig { |
| 7 | + /** |
| 8 | + * @see [ignoredNodes](https://eslint.org/docs/rules/indent#ignorednodes) |
| 9 | + */ |
| 10 | + ignoredNodes?: string[]; |
| 11 | + /** |
| 12 | + * @see [SwitchCase](https://eslint.org/docs/rules/indent#switchcase) |
| 13 | + */ |
| 14 | + SwitchCase?: number; |
| 15 | + /** |
| 16 | + * @see [VariableDeclarator](https://eslint.org/docs/rules/indent#variabledeclarator) |
| 17 | + */ |
| 18 | + VariableDeclarator?: number | 'first' | { var?: number; let?: number; const?: number }; |
| 19 | + /** |
| 20 | + * @see [outerIIFEBody](https://eslint.org/docs/rules/indent#outeriifebody) |
| 21 | + */ |
| 22 | + outerIIFEBody?: number | 'off'; |
| 23 | + /** |
| 24 | + * @see [MemberExpression](https://eslint.org/docs/rules/indent#memberexpression) |
| 25 | + */ |
| 26 | + MemberExpression?: number; |
| 27 | + /** |
| 28 | + * @see [FunctionDeclaration](https://eslint.org/docs/rules/indent#functiondeclaration) |
| 29 | + */ |
| 30 | + FunctionDeclaration?: { body?: number; parameters?: number | 'first' }; |
| 31 | + /** |
| 32 | + * @see [CallExpression](https://eslint.org/docs/rules/indent#callexpression) |
| 33 | + */ |
| 34 | + CallExpression?: { arguments?: number | 'first' }; |
| 35 | + /** |
| 36 | + * @see [ArrayExpression](https://eslint.org/docs/rules/indent#arrayexpression) |
| 37 | + */ |
| 38 | + ArrayExpression?: number | 'first'; |
| 39 | + /** |
| 40 | + * @see [ObjectExpression](https://eslint.org/docs/rules/indent#objectexpression) |
| 41 | + */ |
| 42 | + ObjectExpression?: number | 'first'; |
| 43 | + /** |
| 44 | + * @see [ImportDeclaration](https://eslint.org/docs/rules/indent#importdeclaration) |
| 45 | + */ |
| 46 | + ImportDeclaration?: number | 'first'; |
| 47 | + /** |
| 48 | + * @see [flatTernaryExpressions](https://eslint.org/docs/rules/indent#flatternaryexpressions) |
| 49 | + */ |
| 50 | + flatTernaryExpressions?: boolean; |
| 51 | + /** |
| 52 | + * @see [offsetTernaryExpressions](https://eslint.org/docs/rules/indent#offsetternaryexpressions) |
| 53 | + */ |
| 54 | + offsetTernaryExpressions?: boolean; |
| 55 | + /** |
| 56 | + * @see [ignoreComments](https://eslint.org/docs/rules/indent#ignorecomments) |
| 57 | + */ |
| 58 | + ignoreComments?: boolean; |
| 59 | +} |
| 60 | + |
| 61 | +/** |
| 62 | + * Option. |
| 63 | + */ |
| 64 | +export type IndentOption = number | 'tab'; |
| 65 | + |
| 66 | +/** |
| 67 | + * Options. |
| 68 | + */ |
| 69 | +export type IndentOptions = [IndentOption?]; |
| 70 | + |
| 71 | +/** |
| 72 | + * Enforce consistent indentation. |
| 73 | + * |
| 74 | + * @see [indent](https://eslint.org/docs/rules/indent) |
| 75 | + */ |
| 76 | +export type IndentRuleConfig = RuleConfig<IndentOptions>; |
| 77 | + |
| 78 | +/** |
| 79 | + * Enforce consistent indentation. |
| 80 | + * |
| 81 | + * @see [indent](https://eslint.org/docs/rules/indent) |
| 82 | + */ |
| 83 | +export interface IndentRule { |
| 84 | + /** |
| 85 | + * Enforce consistent indentation. |
| 86 | + * |
| 87 | + * @see [indent](https://eslint.org/docs/rules/indent) |
| 88 | + */ |
| 89 | + indent: IndentRuleConfig; |
| 90 | +} |
0 commit comments