Commit 28bfda5
committed
feat(template-no-nested-interactive): surface triggering attribute in error message
The error said "Do not nest interactive element <button> inside <div>." which
hides why the rule fired — authors had to inspect the rule source to find
that role/contenteditable/tabindex on the parent or child was the trigger.
Now the message names the disambiguating attribute when the bare tag would
be uninformative:
Do not nest interactive element <button> inside <div role="menu">.
Do not nest interactive element <input> inside <div contenteditable>.
Do not nest interactive element <div tabindex="1"> inside <button>.
Self-explanatory native interactive tags (button, input, a, etc.) keep
their bare-tag form to avoid redundant noise. Applied symmetrically to
both parent and child sides.1 parent 133f2a9 commit 28bfda5
2 files changed
Lines changed: 120 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
52 | 96 | | |
53 | 97 | | |
54 | 98 | | |
| |||
222 | 266 | | |
223 | 267 | | |
224 | 268 | | |
225 | | - | |
| 269 | + | |
226 | 270 | | |
227 | 271 | | |
228 | 272 | | |
| |||
244 | 288 | | |
245 | 289 | | |
246 | 290 | | |
247 | | - | |
| 291 | + | |
248 | 292 | | |
249 | 293 | | |
250 | 294 | | |
251 | 295 | | |
252 | 296 | | |
253 | 297 | | |
254 | 298 | | |
255 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
256 | 305 | | |
257 | 306 | | |
258 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
277 | 289 | | |
278 | 290 | | |
279 | 291 | | |
| |||
422 | 434 | | |
423 | 435 | | |
424 | 436 | | |
425 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
426 | 440 | | |
427 | 441 | | |
428 | 442 | | |
| |||
466 | 480 | | |
467 | 481 | | |
468 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
469 | 536 | | |
470 | 537 | | |
0 commit comments