BIND010: map-transform-duplicate-input
Map transform maps the same input twice
| Code | BIND010 |
| Name | map-transform-duplicate-input |
| Category | Bindings and expressions (BIND) |
| Default severity | warning |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports map transform rows whose input equals the input of an earlier row
of the same transform (same value and type: 1 and "1" are different,
1 and 1.0 are the same; expression inputs are compared as text).
Why is this bad?
Section titled “Why is this bad?”The map transform uses the first matching row, so the later row is dead. It is usually a copy-paste error where the input was meant to change.
Example
Section titled “Example”"mappings": [{"input": 1, "output": "Running"}, {"input": 1, "output": "Stopped"}]Use instead:
"mappings": [{"input": 1, "output": "Running"}, {"input": 2, "output": "Stopped"}]Generated from the rule metadata by iglint generate-docs; iglint rule BIND010 prints the same page in the terminal. Source: docs/rules/BIND010.md.