VIEW019: output-param-never-written
Output parameter is never written
| Code | VIEW019 |
| Name | output-param-never-written |
| Category | View structure (VIEW) |
| Default severity | info |
| Enabled by default | no |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports view parameters with paramDirection: "output" that nothing in the
view writes: no binding on the parameter, no bidirectional property binding
targeting it, and no script assignment (self.view.params.result = ...,
found on the parsed scripts; see VIEW015 for how scripts are followed).
Views whose scripts use the parameters in a way that cannot be followed are
not reported.
Why is this bad?
Section titled “Why is this bad?”An output parameter exists so the embedding view can read a value back. If
the view never sets it, the caller always sees the default stored in
view.json, which is usually a mistake (a parameter that should be an
input, or a forgotten assignment).
Example
Section titled “Example”{"params": {"selected": null}, "propConfig": {"params.selected": {"paramDirection": "output"}}}Use instead: bind the parameter ("binding": {"type": "property", ...}) or
assign it in a script, or make it an input.
ign-lint
Section titled “ign-lint”No equivalent.
Generated from the rule metadata by iglint generate-docs; iglint rule VIEW019 prints the same page in the terminal. Source: docs/rules/VIEW019.md.