From 5142847265772eafadbfd29af34ee138507e10b1 Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Mon, 5 Oct 2026 19:51:27 +0200 Subject: [PATCH] docs: explain optional props absent from known callers --- analysis/dead-code.mdx | 6 ++++ cli/dead-code.mdx | 5 +++ configuration/rules.mdx | 3 +- explanations/dead-code.mdx | 61 +++++++++++++++++++++++++++++++++++- integrations/mcp.mdx | 16 ++++++++++ public-content-manifest.json | 22 ++++++------- 6 files changed, 100 insertions(+), 13 deletions(-) diff --git a/analysis/dead-code.mdx b/analysis/dead-code.mdx index 46df31a..ee85524 100644 --- a/analysis/dead-code.mdx +++ b/analysis/dead-code.mdx @@ -82,6 +82,12 @@ fallow dead-code --unused-exports --unused-types fallow dead-code --unresolved-imports --unlisted-deps ``` +## Optional props that callers never supply + +[Absent component props](/explanations/dead-code#absent-component-props) are optional props that a component reads but no inspected reachable caller supplies. Enable `rules.absent-component-props` with `warn` or `error`. The rule starts off because a default or a stable API can make an omitted prop intentional. + +Fallow reports candidates only when it knows at least one reachable caller and can account for the component's callers statically. Unknown spreads, forwarding, dynamic use, and external package users prevent that conclusion. A finding includes the declaration, inspected callers, and whether a default exists. Review that evidence before changing the component. Fallow does not remove the prop or its conditional UI automatically. + ## Output formats diff --git a/cli/dead-code.mdx b/cli/dead-code.mdx index 39f3a7d..50875d6 100644 --- a/cli/dead-code.mdx +++ b/cli/dead-code.mdx @@ -47,6 +47,7 @@ fallow check # Hidden alias for fallow dead-code | `--unprovided-injects` | Report only unprovided injects | | `--unrendered-components` | Report only unrendered components | | `--unused-component-props` | Report only unused component props | +| `--absent-component-props` | Opt in to [absent component props](/explanations/dead-code#absent-component-props) and report only that issue type | | `--unused-component-emits` | Report only unused component emits | | `--unused-component-inputs` | Report only unused component inputs | | `--unused-component-outputs` | Report only unused component outputs | @@ -402,6 +403,10 @@ The JSON output always includes a `summary` counts object, with a count for each `deprecated_exports_in_use` works the same way: the array and the `summary.deprecated_exports_in_use` count are always in the JSON output. Fallow fills the array only when you enable the rule with `--deprecated-exports-in-use` or in `rules`. An `unused_exports` entry for an export with a `@deprecated` tag has `deprecated: true` and, when the tag has a message, `deprecated_reason`. Both keys are absent when the export is not deprecated. +`absent_component_props` contains optional props that their component reads but no inspected reachable caller supplies. Fallow omits this array when it is empty; `summary.absent_component_props` still reports its count. The rule is off by default. Enable it with `--absent-component-props`, or set `absent-component-props` to `warn` or `error` in `rules`. These are manual review candidates. See [Absent component props](/explanations/dead-code#absent-component-props) for supported syntax and exclusions. + +Each entry has `component_name`, `prop_name`, and `framework` to identify the prop. `has_default` records whether the declaration has a default. `path`, `line`, and `col` point to the declaration. Each entry in `inspected_call_sites` has `path`, `line`, and `col` for a reachable caller that fallow inspected. Review those callers and the default before proposing a change. + Each finding has an optional `effective_severity` field (`error` or `warn`) with its rule severity, after `overrides[].rules`. The CI formats read it. See [Levels in CI formats](/configuration/rules#levels-in-ci-formats). ### `used_in_workspaces` diff --git a/configuration/rules.mdx b/configuration/rules.mdx index 53ba9a1..9f69548 100644 --- a/configuration/rules.mdx +++ b/configuration/rules.mdx @@ -21,7 +21,7 @@ Start with all rules as `warn`. Promote one type at a time to `error` when you h When you do not configure a rule, it uses its default severity. The **Default** column in [Available rule names](#available-rule-names) shows the default of each rule. The defaults by group: -- Default `off` (opt-in): `private-type-leaks`, `deprecated-exports-in-use`, `prop-drilling`, `thin-wrapper`, `duplicate-prop-shape`, `coverage-gaps`, `feature-flags`, `require-suppression-reason`, `security-client-server-leak`, and `security-sink`. +- Default `off` (opt-in): `private-type-leaks`, `deprecated-exports-in-use`, `absent-component-props`, `prop-drilling`, `thin-wrapper`, `duplicate-prop-shape`, `coverage-gaps`, `feature-flags`, `require-suppression-reason`, `security-client-server-leak`, and `security-sink`. - Default `warn`: - Dependency hygiene: `unused-dev-dependencies`, `unused-optional-dependencies`, `type-only-dependencies`, `test-only-dependencies`, and `dev-dependencies-in-production`. - Framework components: `unused-store-members`, `unprovided-injects`, `unrendered-components`, `unused-component-props`, `unused-component-emits`, `unused-component-inputs`, `unused-component-outputs`, `unused-svelte-events`, `unused-server-actions`, and `unused-load-data-keys`. @@ -108,6 +108,7 @@ stale-suppressions = "warn" | `unprovided-injects` | `warn` | `inject()` or `getContext()` reads a key that no `provide()` or `setContext()` supplies | | `unrendered-components` | `warn` | A Vue or Svelte component that a barrel exports but that no code renders | | `unused-component-props` | `warn` | A Vue, Svelte, or React component prop that its own component never references. See [`unusedComponentProps`](/configuration/overview#unusedcomponentprops) | +| `absent-component-props` | `off` | An optional prop that its component reads but no inspected reachable caller supplies. Requires known callers and a complete static caller set. Review defaults and API intent before changing it. See [Absent component props](/explanations/dead-code#absent-component-props) | | `unused-component-emits` | `warn` | A Vue `