Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.11 KB

no-destructuring.md

File metadata and controls

38 lines (25 loc) · 1.11 KB

Disallow destructuring that does not meet certain conditions (th-rules/no-destructuring)

💼 This rule is enabled in the following configs: ✅ recommended, recommended-react, recommended-typescript.

Options

Name Type
maximumDestructuredVariables Integer
maximumLineLength Integer

Description

This rule disallows destructuring that does not meet certain conditions, aiming to prevent overly complex destructuring patterns and ensure code readability.

Rule Details

This rule checks for:

  • Destructuring at a nesting level above 3.
  • Destructuring of more than the specified maximum number of variables (default is 2).
  • Destructuring on a line exceeding the specified maximum line length (default is 100 characters).

Usage

{
  "rules": {
    "th-rules/no-destructuring": ["error", { "maximumDestructuredVariables": 2, "maximumLineLength": 100 }]
  }
}