|
| 1 | +--- |
| 2 | +"@objectstack/lint": minor |
| 3 | +"@objectstack/cli": patch |
| 4 | +--- |
| 5 | + |
| 6 | +refactor(lint): one entry point for the reference-integrity suite (#3583 D5) |
| 7 | + |
| 8 | +Six rules that answer the same question — "does this name resolve to anything?" |
| 9 | +— were wired by hand into three CLI commands, so landing a rule meant editing |
| 10 | +`validate`, `lint` and `compile`, and forgetting one meant the same stack got a |
| 11 | +different verdict depending on which command the author ran. |
| 12 | + |
| 13 | +New public API on `@objectstack/lint`: |
| 14 | + |
| 15 | +- `validateReferenceIntegrity(stack)` — runs every reference-integrity rule and |
| 16 | + returns the concatenated findings. |
| 17 | +- `REFERENCE_INTEGRITY_RULES` — the ordered list behind it (`validateObjectReferences`, |
| 18 | + `validateActionNameRefs`, `validatePageFieldBindings`, `validateChartBindings`, |
| 19 | + `validateNavAccess`, `validateTranslationReferences`). |
| 20 | +- `ReferenceIntegrityFinding` / `ReferenceIntegrityRule` / `ReferenceIntegritySeverity` |
| 21 | + — one finding type instead of a six-way union. |
| 22 | + |
| 23 | +Adding a rule to that list reaches `validate`, `lint` and `compile` with no |
| 24 | +further wiring. The individual rule exports are unchanged, so nothing that |
| 25 | +imports them directly needs to move. |
| 26 | + |
| 27 | +Behaviour-preserving: identical findings on the three example apps (zero) and |
| 28 | +on the HotCRM corpus (24, unchanged per rule). `os doctor` is deliberately not |
| 29 | +converted — it runs only `validateWidgetBindings` and is an environment health |
| 30 | +check rather than an authoring gate. |
0 commit comments