PERF001: deep-component-nesting
Components nested deeper than max-depth
| Code | PERF001 |
| Name | deep-component-nesting |
| Category | Performance (PERF) |
| Default severity | info |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports components nested more than max-depth containers below the
view's root container. Only the first component beyond the limit on each
branch is reported.
Why is this bad?
Section titled “Why is this bad?”Every container level adds DOM elements, layout work in the browser and property tree nodes on the gateway. Deep trees are slow to render and hard to maintain; an embedded view or a flatter layout usually does the same.
Example
Section titled “Example”A label inside fourteen nested flex containers.
Use instead: move the inner part into its own view and embed it, or remove containers that only wrap a single child.
Options
Section titled “Options”max-depth(default12): the deepest allowed level; the root container is level 0.
Option reference
Section titled “Option reference”Set in [rules.PERF001] of iglint.toml (or [tool.iglint.rules.PERF001] in pyproject.toml).
| Option | Type | Default | Description |
|---|---|---|---|
max-depth |
integer | 12 |
Deepest allowed nesting level (root container is 0). |
Generated from the rule metadata by iglint generate-docs; iglint rule PERF001 prints the same page in the terminal. Source: docs/rules/PERF001.md.