@db-ux/core-eslint-plugin 0.0.0 → 4.4.2-eslint-plugin2-696cb23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +843 -0
  3. package/build/index.d.ts +352 -0
  4. package/build/index.js +82 -0
  5. package/build/rules/accordion/accordion-item-headline-required.d.ts +16 -0
  6. package/build/rules/accordion/accordion-item-headline-required.js +61 -0
  7. package/build/rules/accordion/no-nested-accordion.d.ts +16 -0
  8. package/build/rules/accordion/no-nested-accordion.js +54 -0
  9. package/build/rules/badge/badge-corner-placement-rules.d.ts +18 -0
  10. package/build/rules/badge/badge-corner-placement-rules.js +114 -0
  11. package/build/rules/badge/badge-no-inline-in-interactive.d.ts +17 -0
  12. package/build/rules/badge/badge-no-inline-in-interactive.js +129 -0
  13. package/build/rules/button/button-no-text-requires-tooltip.d.ts +18 -0
  14. package/build/rules/button/button-no-text-requires-tooltip.js +109 -0
  15. package/build/rules/button/button-single-icon-attribute.d.ts +16 -0
  16. package/build/rules/button/button-single-icon-attribute.js +49 -0
  17. package/build/rules/button/button-type-required.d.ts +17 -0
  18. package/build/rules/button/button-type-required.js +58 -0
  19. package/build/rules/close-button/close-button-text-required.d.ts +16 -0
  20. package/build/rules/close-button/close-button-text-required.js +38 -0
  21. package/build/rules/content/text-or-children-required.d.ts +16 -0
  22. package/build/rules/content/text-or-children-required.js +47 -0
  23. package/build/rules/form/form-label-required.d.ts +16 -0
  24. package/build/rules/form/form-label-required.js +45 -0
  25. package/build/rules/form/form-validation-message-required.d.ts +16 -0
  26. package/build/rules/form/form-validation-message-required.js +91 -0
  27. package/build/rules/header/header-burger-menu-label-required.d.ts +16 -0
  28. package/build/rules/header/header-burger-menu-label-required.js +43 -0
  29. package/build/rules/icon/prefer-icon-attribute.d.ts +17 -0
  30. package/build/rules/icon/prefer-icon-attribute.js +82 -0
  31. package/build/rules/input/input-file-type-validation.d.ts +18 -0
  32. package/build/rules/input/input-file-type-validation.js +50 -0
  33. package/build/rules/input/input-type-required.d.ts +17 -0
  34. package/build/rules/input/input-type-required.js +54 -0
  35. package/build/rules/link/link-external-security.d.ts +19 -0
  36. package/build/rules/link/link-external-security.js +166 -0
  37. package/build/rules/navigation/navigation-item-back-button-text-required.d.ts +16 -0
  38. package/build/rules/navigation/navigation-item-back-button-text-required.js +43 -0
  39. package/build/rules/select/custom-select-tags-remove-text-required.d.ts +16 -0
  40. package/build/rules/select/custom-select-tags-remove-text-required.js +33 -0
  41. package/build/rules/select/select-requires-options.d.ts +16 -0
  42. package/build/rules/select/select-requires-options.js +45 -0
  43. package/build/rules/tag/tag-removable-remove-button-required.d.ts +16 -0
  44. package/build/rules/tag/tag-removable-remove-button-required.js +49 -0
  45. package/build/rules/tooltip/no-interactive-tooltip-content.d.ts +15 -0
  46. package/build/rules/tooltip/no-interactive-tooltip-content.js +49 -0
  47. package/build/rules/tooltip/tooltip-requires-interactive-parent.d.ts +15 -0
  48. package/build/rules/tooltip/tooltip-requires-interactive-parent.js +47 -0
  49. package/build/shared/constants.d.ts +58 -0
  50. package/build/shared/constants.js +98 -0
  51. package/build/shared/utils.d.ts +54 -0
  52. package/build/shared/utils.js +178 -0
  53. package/package.json +37 -1
package/README.md ADDED
@@ -0,0 +1,843 @@
1
+ # @db-ux/eslint-plugin
2
+
3
+ ESLint plugin to validate correct usage of DB UX Design System components across React, Vue, and Angular.
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ npm install eslint @db-ux/eslint-plugin --save-dev
9
+ ```
10
+
11
+ **For Vue projects**, also install `vue-eslint-parser`:
12
+
13
+ ```shell
14
+ npm install vue-eslint-parser --save-dev
15
+ ```
16
+
17
+ **For Angular projects**, also install `@angular-eslint/template-parser`:
18
+
19
+ ```shell
20
+ npm install @angular-eslint/template-parser --save-dev
21
+ ```
22
+
23
+ **For React/TypeScript projects**, also install `@typescript-eslint/parser`:
24
+
25
+ ```shell
26
+ npm install @typescript-eslint/parser --save-dev
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ Add to your ESLint config:
32
+
33
+ **ESLint 9+ (flat config):**
34
+
35
+ ```js
36
+ import dbUx from "@db-ux/eslint-plugin";
37
+
38
+ export default [
39
+ {
40
+ plugins: {
41
+ "db-ux": dbUx
42
+ },
43
+ rules: dbUx.configs.recommended.rules
44
+ }
45
+ ];
46
+ ```
47
+
48
+ **For Vue projects**, configure the Vue parser:
49
+
50
+ ```js
51
+ import dbUx from "@db-ux/eslint-plugin";
52
+ import vueParser from "vue-eslint-parser";
53
+ import tsParser from "@typescript-eslint/parser";
54
+
55
+ export default [
56
+ {
57
+ files: ["**/*.vue"],
58
+ languageOptions: {
59
+ parser: vueParser,
60
+ parserOptions: {
61
+ parser: tsParser,
62
+ ecmaVersion: "latest",
63
+ sourceType: "module"
64
+ }
65
+ },
66
+ plugins: {
67
+ "db-ux": dbUx
68
+ },
69
+ rules: dbUx.configs.recommended.rules
70
+ }
71
+ ];
72
+ ```
73
+
74
+ **For Angular projects**, configure the Angular template parser:
75
+
76
+ ```js
77
+ import dbUx from "@db-ux/eslint-plugin";
78
+ import angularTemplateParser from "@angular-eslint/template-parser";
79
+
80
+ export default [
81
+ {
82
+ files: ["**/*.html"],
83
+ languageOptions: {
84
+ parser: angularTemplateParser
85
+ },
86
+ plugins: {
87
+ "db-ux": dbUx
88
+ },
89
+ rules: dbUx.configs.recommended.rules
90
+ }
91
+ ];
92
+ ```
93
+
94
+ **Or enable rules individually:**
95
+
96
+ ```js
97
+ import dbUx from "@db-ux/eslint-plugin";
98
+
99
+ export default [
100
+ {
101
+ plugins: {
102
+ "db-ux": dbUx
103
+ },
104
+ rules: {
105
+ "db-ux/button-no-text-requires-tooltip": "error"
106
+ }
107
+ }
108
+ ];
109
+ ```
110
+
111
+ **For React/TypeScript projects**, configure the TypeScript parser:
112
+
113
+ ```js
114
+ import dbUx from "@db-ux/eslint-plugin";
115
+ import tsParser from "@typescript-eslint/parser";
116
+
117
+ export default [
118
+ {
119
+ files: ["**/*.ts", "**/*.tsx"],
120
+ languageOptions: {
121
+ parser: tsParser,
122
+ parserOptions: {
123
+ ecmaVersion: "latest",
124
+ sourceType: "module",
125
+ ecmaFeatures: { jsx: true }
126
+ }
127
+ },
128
+ plugins: {
129
+ "db-ux": dbUx
130
+ },
131
+ rules: dbUx.configs.recommended.rules
132
+ }
133
+ ];
134
+ ```
135
+
136
+ ## Rules
137
+
138
+ ### `button-no-text-requires-tooltip`
139
+
140
+ Ensures that buttons with `noText` prop have both an `icon` (or `iconLeading`/`iconTrailing`) and a `DBTooltip` child.
141
+
142
+ **❌ Invalid:**
143
+
144
+ ```jsx
145
+ // React
146
+ <DBButton noText>Save</DBButton>
147
+ <DBButton icon="save" noText>Save</DBButton>
148
+
149
+ // Angular
150
+ <db-button [noText]="true">ABC</db-button>
151
+ <db-button icon="x" [noText]="true">ABC</db-button>
152
+
153
+ // Vue
154
+ <DBButton :noText="true">ABC</DBButton>
155
+ <DBButton icon="x" :noText="true">ABC</DBButton>
156
+ ```
157
+
158
+ **✅ Valid:**
159
+
160
+ ```jsx
161
+ // React
162
+ <DBButton icon="save" noText>
163
+ Save
164
+ <DBTooltip>Save document</DBTooltip>
165
+ </DBButton>
166
+
167
+ // Angular
168
+ <db-button icon="x_placeholder" [noText]="true">
169
+ ABC
170
+ <db-tooltip>ABC</db-tooltip>
171
+ </db-button>
172
+
173
+ // Vue
174
+ <DBButton icon="x_placeholder" :noText="true">
175
+ ABC
176
+ <DBTooltip>ABC</DBTooltip>
177
+ </DBButton>
178
+ ```
179
+
180
+ ## Supported Frameworks
181
+
182
+ - React (JSX/TSX)
183
+ - Vue (SFC)
184
+ - Angular (Templates)
185
+
186
+ The plugin automatically detects the framework based on file extension and parser.
187
+
188
+ ### `button-type-required`
189
+
190
+ Ensures that DBButton has an explicit `type` attribute (submit, button, or reset).
191
+
192
+ **❌ Invalid:**
193
+
194
+ ```jsx
195
+ <DBButton>Save</DBButton>
196
+ <db-button>Save</db-button>
197
+ ```
198
+
199
+ **✅ Valid:**
200
+
201
+ ```jsx
202
+ <DBButton type="button">Save</DBButton>
203
+ <DBButton type="submit">Submit</DBButton>
204
+ <DBButton type="reset">Reset</DBButton>
205
+ ```
206
+
207
+ ### `form-label-required`
208
+
209
+ Ensures that form components (DBInput, DBTextarea, DBSelect, DBCustomSelect, DBCheckbox, DBRadio, DBSwitch) have a `label` attribute for accessibility.
210
+
211
+ **❌ Invalid:**
212
+
213
+ ```jsx
214
+ // React
215
+ <DBInput />
216
+ <DBCheckbox />
217
+ <DBSelect />
218
+
219
+ // Angular
220
+ <db-input></db-input>
221
+ <db-checkbox></db-checkbox>
222
+
223
+ // Vue
224
+ <DBInput />
225
+ <DBCheckbox />
226
+ ```
227
+
228
+ **✅ Valid:**
229
+
230
+ ```jsx
231
+ // React
232
+ <DBInput label="Name" />
233
+ <DBCheckbox label="Accept terms" />
234
+ <DBSelect label="Country" />
235
+
236
+ // Angular
237
+ <db-input label="Name"></db-input>
238
+ <db-checkbox [label]="labelText"></db-checkbox>
239
+
240
+ // Vue
241
+ <DBInput :label="dynamicLabel" />
242
+ <DBCheckbox label="Accept terms" />
243
+ ```
244
+
245
+ ### `prefer-icon-attribute`
246
+
247
+ Prefer using the `icon` attribute over `<DBIcon>` child component for components that support icon attributes.
248
+
249
+ **❌ Invalid:**
250
+
251
+ ```jsx
252
+ // React
253
+ <DBButton><DBIcon icon="save" /></DBButton>
254
+ <DBInput><DBIcon icon="search" /></DBInput>
255
+
256
+ // Angular
257
+ <db-button><db-icon icon="save"></db-icon></db-button>
258
+
259
+ // Vue
260
+ <DBLink><DBIcon icon="external" /></DBLink>
261
+ ```
262
+
263
+ **✅ Valid:**
264
+
265
+ ```jsx
266
+ // React
267
+ <DBButton icon="save">Save</DBButton>
268
+ <DBInput icon="search" />
269
+
270
+ // Angular
271
+ <db-button icon="save">Save</db-button>
272
+
273
+ // Vue
274
+ <DBLink :icon="iconName">Link</DBLink>
275
+ ```
276
+
277
+ ### `text-or-children-required`
278
+
279
+ Ensures that components (DBAccordionItem, DBBadge, DBButton, DBLink, DBIcon, DBInfotext, DBNavigationItem, DBNotification) have either a `text` property or children content.
280
+
281
+ **❌ Invalid:**
282
+
283
+ ```jsx
284
+ // React
285
+ <DBButton />
286
+ <DBLink />
287
+ <DBBadge />
288
+
289
+ // Angular
290
+ <db-button></db-button>
291
+ <db-notification></db-notification>
292
+
293
+ // Vue
294
+ <DBIcon icon="test" />
295
+ ```
296
+
297
+ **✅ Valid:**
298
+
299
+ ```jsx
300
+ // React
301
+ <DBButton text="Save" />
302
+ <DBButton>Save</DBButton>
303
+ <DBLink>Click here</DBLink>
304
+
305
+ // Angular
306
+ <db-button text="Save"></db-button>
307
+ <db-button>Save</db-button>
308
+
309
+ // Vue
310
+ <DBBadge>New</DBBadge>
311
+ <DBIcon icon="test">Label</DBIcon>
312
+ ```
313
+
314
+ ### `no-interactive-tooltip-content`
315
+
316
+ Prevents interactive elements (buttons, links, inputs) inside DBTooltip. Use DBPopover for interactive content.
317
+
318
+ **❌ Invalid:**
319
+
320
+ ```jsx
321
+ // React
322
+ <DBTooltip><button>Click</button></DBTooltip>
323
+ <DBTooltip><DBButton>Action</DBButton></DBTooltip>
324
+ <DBTooltip><a href="#">Link</a></DBTooltip>
325
+
326
+ // Angular
327
+ <db-tooltip><button>Click</button></db-tooltip>
328
+ <db-tooltip><db-button>Action</db-button></db-tooltip>
329
+
330
+ // Vue
331
+ <DBTooltip><DBLink href="#">Link</DBLink></DBTooltip>
332
+ ```
333
+
334
+ **✅ Valid:**
335
+
336
+ ```jsx
337
+ // React
338
+ <DBTooltip>Simple text</DBTooltip>
339
+ <DBTooltip><span>Text with span</span></DBTooltip>
340
+ <DBTooltip><p>Paragraph</p></DBTooltip>
341
+
342
+ // For interactive content, use DBPopover:
343
+ <DBPopover><DBButton>Action</DBButton></DBPopover>
344
+ ```
345
+
346
+ ### `tooltip-requires-interactive-parent`
347
+
348
+ Ensures DBTooltip is a child of an interactive element for accessibility (users must be able to focus the parent).
349
+
350
+ **❌ Invalid:**
351
+
352
+ ```jsx
353
+ // React
354
+ <span>Show more<DBTooltip>XXX</DBTooltip></span>
355
+ <div>Text<DBTooltip>Info</DBTooltip></div>
356
+ <DBBadge>Badge<DBTooltip>Info</DBTooltip></DBBadge>
357
+
358
+ // Angular
359
+ <span>Show more<db-tooltip>XXX</db-tooltip></span>
360
+
361
+ // Vue
362
+ <div>Text<DBTooltip>Info</DBTooltip></div>
363
+ ```
364
+
365
+ **✅ Valid:**
366
+
367
+ ```jsx
368
+ // React
369
+ <button>Save<DBTooltip>Save document</DBTooltip></button>
370
+ <DBButton>Save<DBTooltip>Save document</DBTooltip></DBButton>
371
+ <a href="#">Link<DBTooltip>More info</DBTooltip></a>
372
+
373
+ // Angular
374
+ <db-button>Save<db-tooltip>Save document</db-tooltip></db-button>
375
+
376
+ // Vue
377
+ <DBLink href="#">Link<DBTooltip>More info</DBTooltip></DBLink>
378
+ ```
379
+
380
+ ### `no-nested-accordion`
381
+
382
+ Prevents nesting DBAccordion components inside each other as it confuses users.
383
+
384
+ **❌ Invalid:**
385
+
386
+ ```jsx
387
+ // React
388
+ <DBAccordion><DBAccordion>Nested</DBAccordion></DBAccordion>
389
+ <DBAccordion><DBAccordionItem><DBAccordion>Deep</DBAccordion></DBAccordionItem></DBAccordion>
390
+
391
+ // Angular
392
+ <db-accordion><db-accordion>Nested</db-accordion></db-accordion>
393
+
394
+ // Vue
395
+ <DBAccordion><div><DBAccordion>Nested</DBAccordion></div></DBAccordion>
396
+ ```
397
+
398
+ **✅ Valid:**
399
+
400
+ ```jsx
401
+ // React
402
+ <DBAccordion><DBAccordionItem>Item</DBAccordionItem></DBAccordion>
403
+ <div><DBAccordion>First</DBAccordion></div>
404
+ <DBAccordion>First</DBAccordion><DBAccordion>Second</DBAccordion>
405
+ ```
406
+
407
+ ### `badge-corner-placement-rules`
408
+
409
+ Ensures DBBadge with corner placement has max 3 characters and a label attribute for accessibility.
410
+
411
+ **❌ Invalid:**
412
+
413
+ ```jsx
414
+ // React
415
+ <DBBadge placement="corner-top-left">9999</DBBadge>
416
+ <DBBadge placement="corner-top-right" text="1234" />
417
+ <DBBadge placement="corner-top-left">99</DBBadge>
418
+
419
+ // Angular
420
+ <db-badge placement="corner-top-left">9999</db-badge>
421
+
422
+ // Vue
423
+ <DBBadge placement="corner-top-right">Long text</DBBadge>
424
+ ```
425
+
426
+ **✅ Valid:**
427
+
428
+ ```jsx
429
+ // React
430
+ <DBBadge>Long text is fine</DBBadge>
431
+ <DBBadge placement="inline">Long text</DBBadge>
432
+ <DBBadge placement="corner-top-left" label="New items">99+</DBBadge>
433
+ <DBBadge placement="corner-top-right" text="5" label="Notifications" />
434
+
435
+ // Auto-fix converts:
436
+ <DBBadge placement="corner-top-left">9999</DBBadge>
437
+ // to:
438
+ <DBBadge placement="corner-top-left" label="9999">999</DBBadge>
439
+ ```
440
+
441
+ ### `badge-no-inline-in-interactive`
442
+
443
+ Prevents DBBadge with inline placement inside interactive elements (DBButton, DBLink). Use corner placement instead.
444
+
445
+ **❌ Invalid:**
446
+
447
+ ```jsx
448
+ // React
449
+ <DBButton><DBBadge placement="inline">Badge</DBBadge>Button</DBButton>
450
+ <DBLink><DBBadge placement="inline">Badge</DBBadge>Link</DBLink>
451
+
452
+ // Angular
453
+ <db-button><db-badge placement="inline">Badge</db-badge>Button</db-button>
454
+
455
+ // Vue
456
+ <DBButton><DBBadge placement="inline">Badge</DBBadge>Button</DBButton>
457
+ ```
458
+
459
+ **✅ Valid:**
460
+
461
+ ```jsx
462
+ // React
463
+ <DBBadge placement="inline">Badge</DBBadge>
464
+ <DBButton><DBBadge placement="corner-top-right" label="New">5</DBBadge>Button</DBButton>
465
+ <DBLink><DBBadge placement="corner-top-left" label="Count">3</DBBadge>Link</DBLink>
466
+
467
+ // Auto-fix converts:
468
+ <DBButton><DBBadge placement="inline">Badge</DBBadge>Button</DBButton>
469
+ // to:
470
+ <DBButton><DBBadge placement="corner-top-right">Badge</DBBadge>Button</DBButton>
471
+ ```
472
+
473
+ ### `button-single-icon-attribute`
474
+
475
+ Ensures DBButton uses only one icon attribute (icon, iconLeading, or iconTrailing).
476
+
477
+ **❌ Invalid:**
478
+
479
+ ```jsx
480
+ // React
481
+ <DBButton icon="save" iconLeading="save">Save</DBButton>
482
+ <DBButton icon="save" iconTrailing="arrow">Save</DBButton>
483
+ <DBButton iconLeading="save" iconTrailing="arrow">Save</DBButton>
484
+
485
+ // Angular
486
+ <db-button icon="save" [iconLeading]="iconName">Save</db-button>
487
+
488
+ // Vue
489
+ <DBButton icon="save" :iconTrailing="icon">Save</DBButton>
490
+ ```
491
+
492
+ **✅ Valid:**
493
+
494
+ ```jsx
495
+ // React
496
+ <DBButton icon="save">Save</DBButton>
497
+ <DBButton iconLeading="save">Save</DBButton>
498
+ <DBButton iconTrailing="arrow">Next</DBButton>
499
+
500
+ // Angular
501
+ <db-button icon="save">Save</db-button>
502
+ <db-button [iconLeading]="iconName">Save</db-button>
503
+
504
+ // Vue
505
+ <DBButton :iconTrailing="icon">Next</DBButton>
506
+ ```
507
+
508
+ ### `link-external-security`
509
+
510
+ Ensures external links have proper security attributes (target="\_blank" and referrerPolicy).
511
+
512
+ **❌ Invalid:**
513
+
514
+ ```jsx
515
+ // React
516
+ <DBLink content="external">External</DBLink>
517
+ <DBLink content="external" target="_blank">External</DBLink>
518
+ <DBLink target="_blank">External</DBLink>
519
+
520
+ // Angular
521
+ <db-link content="external">External</db-link>
522
+
523
+ // Vue
524
+ <DBLink content="external" :target="linkTarget">External</DBLink>
525
+ ```
526
+
527
+ **✅ Valid:**
528
+
529
+ ```jsx
530
+ // React
531
+ <DBLink href="#">Internal link</DBLink>
532
+ <DBLink content="external" target="_blank" referrerPolicy="no-referrer">External</DBLink>
533
+
534
+ // Angular
535
+ <db-link content="external" target="_blank" referrerPolicy="no-referrer">External</db-link>
536
+
537
+ // Vue
538
+ <DBLink content="external" target="_blank" :referrerPolicy="policy">External</DBLink>
539
+ ```
540
+
541
+ ### `select-requires-options`
542
+
543
+ Ensures DBSelect has either an options property or option children.
544
+
545
+ **❌ Invalid:**
546
+
547
+ ```jsx
548
+ // React
549
+ <DBSelect label="Country" />
550
+ <DBSelect label="Country"></DBSelect>
551
+
552
+ // Angular
553
+ <db-select label="Country"></db-select>
554
+
555
+ // Vue
556
+ <DBSelect label="Country" />
557
+ ```
558
+
559
+ **✅ Valid:**
560
+
561
+ ```jsx
562
+ // React
563
+ <DBSelect label="Country">
564
+ <option value="de">Germany</option>
565
+ <option value="us">USA</option>
566
+ </DBSelect>
567
+ <DBSelect label="Country" options={countryOptions} />
568
+
569
+ // Angular
570
+ <db-select label="Country">
571
+ <option value="de">Germany</option>
572
+ </db-select>
573
+ <db-select label="Country" [options]="options"></db-select>
574
+
575
+ // Vue
576
+ <DBSelect label="Country" :options="options" />
577
+ ```
578
+
579
+ ### `close-button-text-required`
580
+
581
+ Ensures components with close buttons have appropriate text attributes for accessibility.
582
+
583
+ **❌ Invalid:**
584
+
585
+ ```jsx
586
+ // React
587
+ <DBNotification>Message</DBNotification>
588
+ <DBDrawer>Content</DBDrawer>
589
+ <DBCustomSelect label="Select" />
590
+
591
+ // Angular
592
+ <db-notification>Message</db-notification>
593
+ <db-drawer>Content</db-drawer>
594
+
595
+ // Vue
596
+ <DBCustomSelect label="Select" />
597
+ ```
598
+
599
+ **✅ Valid:**
600
+
601
+ ```jsx
602
+ // React
603
+ <DBNotification closeButtonText="Close">Message</DBNotification>
604
+ <DBDrawer closeButtonText="Close drawer">Content</DBDrawer>
605
+ <DBCustomSelect mobileCloseButtonText="Close" label="Select" />
606
+
607
+ // Angular
608
+ <db-notification closeButtonText="Close">Message</db-notification>
609
+ <db-drawer [closeButtonText]="closeText">Content</db-drawer>
610
+
611
+ // Vue
612
+ <DBCustomSelect :mobileCloseButtonText="closeText" label="Select" />
613
+ ```
614
+
615
+ ### `header-burger-menu-label-required`
616
+
617
+ Ensures DBHeader has burgerMenuLabel attribute for accessibility.
618
+
619
+ **❌ Invalid:**
620
+
621
+ ```jsx
622
+ // React
623
+ <DBHeader>Content</DBHeader>
624
+ <DBHeader closeButtonText="Close">Content</DBHeader>
625
+
626
+ // Angular
627
+ <db-header>Content</db-header>
628
+
629
+ // Vue
630
+ <DBHeader>Content</DBHeader>
631
+ ```
632
+
633
+ **✅ Valid:**
634
+
635
+ ```jsx
636
+ // React
637
+ <DBHeader burgerMenuLabel="Menu">Content</DBHeader>
638
+ <DBHeader burgerMenuLabel="Open navigation">Content</DBHeader>
639
+
640
+ // Angular
641
+ <db-header burgerMenuLabel="Menu">Content</db-header>
642
+ <db-header [burgerMenuLabel]="menuLabel">Content</db-header>
643
+
644
+ // Vue
645
+ <DBHeader :burgerMenuLabel="label">Content</DBHeader>
646
+ ```
647
+
648
+ ### `navigation-item-back-button-text-required`
649
+
650
+ Ensures DBNavigationItem has backButtonText attribute for accessibility.
651
+
652
+ **❌ Invalid:**
653
+
654
+ ```jsx
655
+ // React
656
+ <DBNavigationItem>Item</DBNavigationItem>
657
+ <DBNavigationItem icon="home">Item</DBNavigationItem>
658
+
659
+ // Angular
660
+ <db-navigation-item>Item</db-navigation-item>
661
+
662
+ // Vue
663
+ <DBNavigationItem>Item</DBNavigationItem>
664
+ ```
665
+
666
+ **✅ Valid:**
667
+
668
+ ```jsx
669
+ // React
670
+ <DBNavigationItem backButtonText="Back">Item</DBNavigationItem>
671
+ <DBNavigationItem backButtonText="Go back">Item</DBNavigationItem>
672
+
673
+ // Angular
674
+ <db-navigation-item backButtonText="Back">Item</db-navigation-item>
675
+ <db-navigation-item [backButtonText]="backText">Item</db-navigation-item>
676
+
677
+ // Vue
678
+ <DBNavigationItem :backButtonText="text">Item</DBNavigationItem>
679
+ ```
680
+
681
+ ### `custom-select-tags-remove-text-required`
682
+
683
+ Ensures DBCustomSelect with selectedType="tag" has removeTagsTexts attribute for accessibility.
684
+
685
+ **❌ Invalid:**
686
+
687
+ ```jsx
688
+ // React
689
+ <DBCustomSelect label="Select" selectedType="tag" />
690
+ <DBCustomSelect label="Select" selectedType="tag" options={opts} />
691
+
692
+ // Angular
693
+ <db-custom-select label="Select" selectedType="tag"></db-custom-select>
694
+
695
+ // Vue
696
+ <DBCustomSelect label="Select" selectedType="tag" />
697
+ ```
698
+
699
+ **✅ Valid:**
700
+
701
+ ```jsx
702
+ // React
703
+ <DBCustomSelect label="Select" />
704
+ <DBCustomSelect label="Select" selectedType="text" />
705
+ <DBCustomSelect label="Select" selectedType="tag" removeTagsTexts={["Remove A", "Remove B"]} />
706
+
707
+ // Angular
708
+ <db-custom-select label="Select" selectedType="tag" removeTagsTexts="texts"></db-custom-select>
709
+
710
+ // Vue
711
+ <DBCustomSelect label="Select" selectedType="tag" :removeTagsTexts="texts" />
712
+ ```
713
+
714
+ ### `tag-removable-remove-button-required`
715
+
716
+ Ensures DBTag with behavior="removable" has removeButton attribute for accessibility.
717
+
718
+ **❌ Invalid:**
719
+
720
+ ```jsx
721
+ // React
722
+ <DBTag behavior="removable">Tag</DBTag>
723
+ <DBTag behavior="removable" semantic="successful">Tag</DBTag>
724
+
725
+ // Angular
726
+ <db-tag behavior="removable">Tag</db-tag>
727
+
728
+ // Vue
729
+ <DBTag behavior="removable">Tag</DBTag>
730
+ ```
731
+
732
+ **✅ Valid:**
733
+
734
+ ```jsx
735
+ // React
736
+ <DBTag>Tag</DBTag>
737
+ <DBTag behavior="static">Tag</DBTag>
738
+ <DBTag behavior="removable" removeButton="Remove">Tag</DBTag>
739
+
740
+ // Angular
741
+ <db-tag behavior="removable" removeButton="Remove">Tag</db-tag>
742
+
743
+ // Vue
744
+ <DBTag behavior="removable" :removeButton="removeText">Tag</DBTag>
745
+ ```
746
+
747
+ ### `form-validation-message-required`
748
+
749
+ Ensures form components with validation attributes have invalidMessage for user feedback.
750
+
751
+ **❌ Invalid:**
752
+
753
+ ```jsx
754
+ // React
755
+ <DBInput label="Name" required />
756
+ <DBTextarea label="Text" maxLength={100} />
757
+ <DBInput label="Age" min={18} />
758
+ <DBInput label="Email" pattern=".*@.*" />
759
+
760
+ // Angular
761
+ <db-input label="Name" required></db-input>
762
+
763
+ // Vue
764
+ <DBInput label="Score" :max="100" />
765
+ ```
766
+
767
+ **✅ Valid:**
768
+
769
+ ```jsx
770
+ // React
771
+ <DBInput label="Name" />
772
+ <DBInput label="Name" required invalidMessage="Required" />
773
+ <DBTextarea label="Text" maxLength={100} invalidMessage="Too long" />
774
+ <DBInput label="Age" min={18} invalidMessage="Must be 18+" />
775
+ <DBInput label="Email" pattern=".*@.*" invalidMessage="Invalid email" />
776
+
777
+ // Applies to: DBInput, DBTextarea, DBSelect, DBCustomSelect, DBCheckbox
778
+ // Checks: required, maxLength, minLength (Input/Textarea), min, max, pattern (Input only)
779
+ ```
780
+
781
+ ### `input-type-required`
782
+
783
+ Suggests adding type attribute to DBInput for better developer experience.
784
+
785
+ **❌ Invalid:**
786
+
787
+ ```jsx
788
+ // React
789
+ <DBInput label="Name" />
790
+ <DBInput label="Name" placeholder="Enter name" />
791
+
792
+ // Angular
793
+ <db-input label="Name"></db-input>
794
+
795
+ // Vue
796
+ <DBInput label="Name" />
797
+ ```
798
+
799
+ **✅ Valid:**
800
+
801
+ ```jsx
802
+ // React
803
+ <DBInput label="Name" type="text" />
804
+ <DBInput label="Email" type="email" />
805
+ <DBInput label="Password" type="password" />
806
+
807
+ // Auto-fix adds:
808
+ <DBInput label="Name" type="text" />
809
+ ```
810
+
811
+ ### `input-file-type-validation`
812
+
813
+ Ensures DBInput with type="file" has accept attribute, and validates file-only attributes.
814
+
815
+ **❌ Invalid:**
816
+
817
+ ```jsx
818
+ // React
819
+ <DBInput label="File" type="file" />
820
+ <DBInput label="Name" type="text" multiple />
821
+ <DBInput label="Name" type="text" accept=".pdf" />
822
+
823
+ // Angular
824
+ <db-input label="File" type="file"></db-input>
825
+
826
+ // Vue
827
+ <DBInput label="Email" type="email" accept=".pdf" multiple />
828
+ ```
829
+
830
+ **✅ Valid:**
831
+
832
+ ```jsx
833
+ // React
834
+ <DBInput label="Name" type="text" />
835
+ <DBInput label="File" type="file" accept=".pdf" />
836
+ <DBInput label="Files" type="file" accept="image/*" multiple />
837
+
838
+ // Angular
839
+ <db-input label="File" type="file" accept=".jpg"></db-input>
840
+
841
+ // Vue
842
+ <DBInput label="File" type="file" accept="image/*" :multiple="true" />
843
+ ```