Commit 1d12b62
committed
fix(lint): a view record is a container — resolve
Running the new rule over HotCRM (~18k lines of shipped metadata) reported
~40 `_views` keys as orphans. Every one of them was correct; the rule was
wrong, in two compounding ways:
1. A view record is a CONTAINER, not a view. The default list lives at `list`
and the named tabs at `listViews.<key>` / `formViews.<key>`, each of which
may also carry its own `name`. Collecting only the record's own `name`
makes every named tab look undeclared.
2. The object binding lives INSIDE the container (`list.data.object`), not at
the record root. The record-level lookup resolved to nothing on the
canonical shape, so the whole record was skipped — which is why the
universe was empty enough to report the app's entire view surface.
The examples missed this because none of their bundles carried `_views` keys
at all: the walk was exercised, but that one branch of the universe never
was. A corpus with the keys present is what caught it — §6.1's point about a
false-positive floor only meaning something when the walk is non-empty applies
per branch, not per rule.
`collectViewRecord` now registers each container under the object THAT
container binds (falling back to the record, then to the default list), and
accepts both the map key and the inner `name` — authors write either, and the
key is what the console renders the tab from. Form sections are collected in
the same pass, so `_sections` gets the same binding fix. Objects carrying
views directly (`objects[].views`, `objects[].listViews`) go through one code
path with the owner pinned.
Three regression tests pin the HotCRM shape.
Residual on HotCRM after the fix: 6 findings, all true —
`apps.crm_enterprise.navigation.group_products` and `.group_analytics` across
three locales, where the app declares group_sales / group_work /
group_marketing / group_service / group_insights and neither translated id
exists.
Refs #3583
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015r31hzuSN19iK8ATRPcCpS_views keys against it (#3583)1 parent f860ae5 commit 1d12b62
2 files changed
Lines changed: 153 additions & 22 deletions
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
404 | 486 | | |
405 | 487 | | |
406 | 488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
201 | 264 | | |
202 | 265 | | |
203 | 266 | | |
| |||
269 | 332 | | |
270 | 333 | | |
271 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
272 | 339 | | |
273 | | - | |
274 | | - | |
| 340 | + | |
275 | 341 | | |
| 342 | + | |
276 | 343 | | |
277 | 344 | | |
278 | 345 | | |
| |||
282 | 349 | | |
283 | 350 | | |
284 | 351 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 352 | + | |
304 | 353 | | |
305 | 354 | | |
306 | 355 | | |
| |||
0 commit comments