Skip to content

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

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.

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.

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.

  • max-depth (default 12): the deepest allowed level; the root container is level 0.

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.