@adyen/eslint-plugin-bento 2.23.0 → 2.24.0

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 (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +31 -15
  3. package/configs/vue-recommended.js +15 -0
  4. package/configs/vue-strict.js +15 -0
  5. package/index.js +3 -0
  6. package/package.json +1 -1
  7. package/rules/deprecation-bento-tag-variant-enum/README.md +69 -0
  8. package/rules/deprecation-bento-tag-variant-enum/deprecation-bento-tag-variant-enum.js +167 -0
  9. package/rules/vue-no-redundant-dialog-v-if/README.md +55 -0
  10. package/rules/vue-no-redundant-dialog-v-if/vue-no-redundant-dialog-v-if.js +150 -0
  11. package/rules/vue-no-use-bento-translation-overrides/README.md +14 -0
  12. package/rules/vue-no-use-bento-translation-overrides/vue-no-use-bento-translation-overrides.js +93 -0
  13. package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/__tests__/deprecation-bento-data-grid-cell-action-menu-item-handler.vue +0 -63
  14. package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/__tests__/eslint.config.js +0 -26
  15. package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/deprecation-bento-data-grid-cell-action-menu-item-handler.integration.test.ts +0 -24
  16. package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/deprecation-bento-data-grid-cell-action-menu-item-handler.test.ts +0 -116
  17. package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/deprecation-bento-date-range-picker-has-actions-prop.vue +0 -10
  18. package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/eslint.config.js +0 -29
  19. package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/remove/deprecation-bento-date-range-picker-has-actions-prop.vue +0 -11
  20. package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/remove/eslint.config.js +0 -29
  21. package/rules/deprecation-bento-date-range-picker-has-actions-prop/deprecation-bento-date-range-picker-has-actions-prop.integration.test.ts +0 -47
  22. package/rules/deprecation-bento-date-range-picker-has-actions-prop/deprecation-bento-date-range-picker-has-actions-prop.test.ts +0 -176
  23. package/rules/deprecation-bento-dropdown-size-prop/__tests__/deprecation-bento-dropdown-size-prop.vue +0 -9
  24. package/rules/deprecation-bento-dropdown-size-prop/__tests__/eslint.config.js +0 -26
  25. package/rules/deprecation-bento-dropdown-size-prop/deprecation-bento-dropdown-size-prop.integration.test.ts +0 -33
  26. package/rules/deprecation-bento-dropdown-size-prop/deprecation-bento-dropdown-size-prop.test.ts +0 -101
  27. package/rules/deprecation-bento-popover-modifiers-prop/__tests__/deprecation-bento-popover-modifiers-prop.vue +0 -9
  28. package/rules/deprecation-bento-popover-modifiers-prop/__tests__/eslint.config.js +0 -26
  29. package/rules/deprecation-bento-popover-modifiers-prop/deprecation-bento-popover-modifiers-prop.integration.test.ts +0 -24
  30. package/rules/deprecation-bento-popover-modifiers-prop/deprecation-bento-popover-modifiers-prop.test.ts +0 -109
  31. package/rules/deprecation-bento-timeline-item-variant-prop/__tests__/deprecation-bento-timeline-item-variant-prop.vue +0 -9
  32. package/rules/deprecation-bento-timeline-item-variant-prop/__tests__/eslint.config.js +0 -26
  33. package/rules/deprecation-bento-timeline-item-variant-prop/deprecation-bento-timeline-item-variant-prop.integration.test.ts +0 -35
  34. package/rules/deprecation-bento-timeline-item-variant-prop/deprecation-bento-timeline-item-variant-prop.test.ts +0 -141
  35. package/rules/deprecation-components-aria-label-prop/__tests__/deprecation-components-aria-label-prop.vue +0 -25
  36. package/rules/deprecation-components-aria-label-prop/__tests__/eslint.config.js +0 -26
  37. package/rules/deprecation-components-aria-label-prop/deprecation-components-aria-label-prop.integration.test.ts +0 -36
  38. package/rules/deprecation-components-aria-label-prop/deprecation-components-aria-label-prop.test.ts +0 -194
  39. package/rules/deprecation-components-error-prop/__tests__/deprecation-components-error-prop.vue +0 -17
  40. package/rules/deprecation-components-error-prop/__tests__/eslint.config.js +0 -26
  41. package/rules/deprecation-components-error-prop/deprecation-components-error-prop.integration.test.ts +0 -41
  42. package/rules/deprecation-components-error-prop/deprecation-components-error-prop.test.ts +0 -153
  43. package/rules/deprecation-components-has-error-prop/__tests__/deprecation-components-has-error-prop.vue +0 -13
  44. package/rules/deprecation-components-has-error-prop/__tests__/eslint.config.js +0 -26
  45. package/rules/deprecation-components-has-error-prop/deprecation-components-has-error-prop.integration.test.ts +0 -37
  46. package/rules/deprecation-components-has-error-prop/deprecation-components-has-error-prop.test.ts +0 -122
  47. package/rules/deprecation-components-input-emit/__tests__/deprecation-components-input-emit.vue +0 -22
  48. package/rules/deprecation-components-input-emit/__tests__/eslint.config.js +0 -25
  49. package/rules/deprecation-components-input-emit/deprecation-components-input-emit.integration.test.ts +0 -43
  50. package/rules/deprecation-components-input-emit/deprecation-components-input-emit.test.ts +0 -320
  51. package/rules/deprecation-components-value-prop/__tests__/deprecation-components-value-prop.vue +0 -69
  52. package/rules/deprecation-components-value-prop/__tests__/eslint.config.js +0 -25
  53. package/rules/deprecation-components-value-prop/deprecation-components-value-prop.integration.test.ts +0 -37
  54. package/rules/deprecation-components-value-prop/deprecation-components-value-prop.test.ts +0 -480
  55. package/rules/deprecation-country-custom-usage/__tests__/deprecation-country-custom-usage.vue +0 -93
  56. package/rules/deprecation-country-custom-usage/__tests__/eslint.config.js +0 -25
  57. package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.integration.test.ts +0 -22
  58. package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.test.ts +0 -380
  59. package/rules/deprecation-currency-default-slot/__tests__/deprecation-currency-default-slot.vue +0 -7
  60. package/rules/deprecation-currency-default-slot/__tests__/eslint.config.js +0 -24
  61. package/rules/deprecation-currency-default-slot/deprecation-currency-default-slot.integration.test.ts +0 -29
  62. package/rules/deprecation-currency-default-slot/deprecation-currency-default-slot.test.ts +0 -136
  63. package/rules/deprecation-filter-bar-deprecated-props/__tests__/deprecation-filter-bar-deprecated-props.vue +0 -62
  64. package/rules/deprecation-filter-bar-deprecated-props/__tests__/eslint.config.js +0 -25
  65. package/rules/deprecation-filter-bar-deprecated-props/deprecation-filter-bar-deprecated-props.integration.test.ts +0 -22
  66. package/rules/deprecation-filter-bar-deprecated-props/deprecation-filter-bar-deprecated-props.test.ts +0 -492
  67. package/rules/deprecation-input-filter-dropdown-options/__tests__/deprecation-input-filter-dropdown-options.vue +0 -46
  68. package/rules/deprecation-input-filter-dropdown-options/__tests__/eslint.config.js +0 -26
  69. package/rules/deprecation-input-filter-dropdown-options/deprecation-input-filter-dropdown-options.integration.test.ts +0 -27
  70. package/rules/deprecation-input-filter-dropdown-options/deprecation-input-filter-dropdown-options.test.ts +0 -392
  71. package/rules/deprecation-tag-default-slot/__tests__/deprecation-tag-default-slot.vue +0 -5
  72. package/rules/deprecation-tag-default-slot/__tests__/eslint.config.js +0 -24
  73. package/rules/deprecation-tag-default-slot/deprecation-tag-default-slot.integration.test.ts +0 -29
  74. package/rules/deprecation-tag-default-slot/deprecation-tag-default-slot.test.ts +0 -163
  75. package/rules/tailwind-v3-to-bento/__tests__/eslint.config.js +0 -24
  76. package/rules/tailwind-v3-to-bento/__tests__/tailwind-v3-to-bento.vue +0 -15
  77. package/rules/tailwind-v3-to-bento/tailwind-v3-to-bento.integration.test.ts +0 -29
  78. package/rules/tailwind-v3-to-bento/tailwind-v3-to-bento.test.ts +0 -403
  79. package/rules/vue-old-spacer-tokens/__tests__/eslint.config.js +0 -24
  80. package/rules/vue-old-spacer-tokens/__tests__/vue-old-spacer-tokens.vue +0 -5
  81. package/rules/vue-old-spacer-tokens/vue-old-spacer-tokens.integration.test.ts +0 -29
  82. package/rules/vue-old-spacer-tokens/vue-old-spacer-tokens.test.ts +0 -77
@@ -1,480 +0,0 @@
1
- import { RuleTester } from 'eslint';
2
- import vueParser from 'vue-eslint-parser';
3
- import tsParser from '@typescript-eslint/parser';
4
- import deprecationComponentsValueProp from './deprecation-components-value-prop';
5
-
6
- const ruleTester = new RuleTester({
7
- languageOptions: {
8
- ecmaVersion: 'latest',
9
- sourceType: 'module',
10
- parser: vueParser,
11
- parserOptions: {
12
- parser: tsParser,
13
- },
14
- },
15
- });
16
-
17
- describe('@adyen/bento/deprecation-components-value-prop', () => {
18
- ruleTester.run('deprecation-components-value-prop', deprecationComponentsValueProp, {
19
- valid: [
20
- {
21
- name: 'Valid usage for bento-date-picker',
22
- filename: 'test.vue',
23
- code: `
24
- <template>
25
- <bento-date-picker model-value="val" />
26
- </template>
27
- `,
28
- },
29
- {
30
- name: 'Valid usage for bento-date-range-picker',
31
- filename: 'test.vue',
32
- code: `
33
- <template>
34
- <bento-date-range-picker model-value="val" />
35
- </template>
36
- `,
37
- },
38
- {
39
- name: 'Valid usage for bento-dropdown',
40
- filename: 'test.vue',
41
- code: `
42
- <template>
43
- <bento-dropdown model-value="val" />
44
- </template>
45
- `,
46
- },
47
- {
48
- name: 'Valid usage for bento-dropdown-avatar',
49
- filename: 'test.vue',
50
- code: `
51
- <template>
52
- <bento-dropdown-avatar model-value="val" />
53
- </template>
54
- `,
55
- },
56
- {
57
- name: 'Valid usage for bento-dropdown-country',
58
- filename: 'test.vue',
59
- code: `
60
- <template>
61
- <bento-dropdown-country model-value="val" />
62
- </template>
63
- `,
64
- },
65
- {
66
- name: 'Valid usage for bento-dropdown-currency',
67
- filename: 'test.vue',
68
- code: `
69
- <template>
70
- <bento-dropdown-currency model-value="val" />
71
- </template>
72
- `,
73
- },
74
- {
75
- name: 'Valid usage for bento-dropdown-payment-method',
76
- filename: 'test.vue',
77
- code: `
78
- <template>
79
- <bento-dropdown-payment-method model-value="val" />
80
- </template>
81
- `,
82
- },
83
- {
84
- name: 'Valid usage for bento-dropdown-tag',
85
- filename: 'test.vue',
86
- code: `
87
- <template>
88
- <bento-dropdown-tag model-value="val" />
89
- </template>
90
- `,
91
- },
92
- {
93
- name: 'Valid usage for bento-file-uploader',
94
- filename: 'test.vue',
95
- code: `
96
- <template>
97
- <bento-file-uploader model-value="val" />
98
- </template>
99
- `,
100
- },
101
- {
102
- name: 'Valid usage for bento-input-field',
103
- filename: 'test.vue',
104
- code: `
105
- <template>
106
- <bento-input-field model-value="val" />
107
- </template>
108
- `,
109
- },
110
- {
111
- name: 'Valid usage for bento-input-field-password',
112
- filename: 'test.vue',
113
- code: `
114
- <template>
115
- <bento-input-field-password model-value="val" />
116
- </template>
117
- `,
118
- },
119
- {
120
- name: 'Valid usage for bento-input-field-phone-number',
121
- filename: 'test.vue',
122
- code: `
123
- <template>
124
- <bento-input-field-phone-number model-value="val" />
125
- </template>
126
- `,
127
- },
128
- {
129
- name: 'Valid usage for bento-checkbox-group',
130
- filename: 'test.vue',
131
- code: `
132
- <template>
133
- <bento-checkbox-group model-value="val" />
134
- </template>
135
- `,
136
- },
137
- {
138
- name: 'Valid usage for bento-radio-group',
139
- filename: 'test.vue',
140
- code: `
141
- <template>
142
- <bento-radio-group model-value="val" />
143
- </template>
144
- `,
145
- },
146
- {
147
- name: 'Valid usage for bento-selection-card-group',
148
- filename: 'test.vue',
149
- code: `
150
- <template>
151
- <bento-selection-card-group model-value="val" />
152
- </template>
153
- `,
154
- },
155
- {
156
- name: 'Valid usage for bento-textarea',
157
- filename: 'test.vue',
158
- code: `
159
- <template>
160
- <bento-textarea model-value="val" />
161
- </template>
162
- `,
163
- },
164
- ],
165
- invalid: [
166
- /* autofix: false */
167
- {
168
- name: 'Invalid: Static prop with autofix disabled (explicit false)',
169
- filename: 'test.vue',
170
- code: `<template><bento-input-field value="val" /></template>`,
171
- output: null,
172
- options: [{ autofix: false }],
173
- errors: [{ messageId: 'deprecation' }],
174
- },
175
- {
176
- name: 'Invalid: Dynamic prop with autofix disabled (no options)',
177
- filename: 'test.vue',
178
- code: `<template><bento-dropdown :value="val" /></template>`,
179
- output: null,
180
- errors: [{ messageId: 'deprecation' }],
181
- },
182
- {
183
- name: 'Invalid: Static prop with autofix disabled (no options)',
184
- filename: 'test.vue',
185
- code: `<template><bento-textarea value="val" /></template>`,
186
- output: null,
187
- errors: [{ messageId: 'deprecation' }],
188
- },
189
- /* autofix: true */
190
- // bento-date-picker: Static
191
- {
192
- name: 'Invalid: Static prop on bento-date-picker',
193
- filename: 'test.vue',
194
- code: `<template><bento-date-picker value="val" /></template>`,
195
- output: `<template><bento-date-picker model-value="val" /></template>`,
196
- options: [{ autofix: true }],
197
- errors: [{ messageId: 'deprecation' }],
198
- },
199
- // bento-date-picker: Shorthand
200
- {
201
- name: 'Invalid: Dynamic prop on bento-date-picker',
202
- filename: 'test.vue',
203
- code: `<template><bento-date-picker :value="val" /></template>`,
204
- output: `<template><bento-date-picker :model-value="val" /></template>`,
205
- options: [{ autofix: true }],
206
- errors: [{ messageId: 'deprecation' }],
207
- },
208
- // bento-date-range-picker: Static
209
- {
210
- name: 'Invalid: Static prop on bento-date-range-picker',
211
- filename: 'test.vue',
212
- code: `<template><bento-date-range-picker value="val" /></template>`,
213
- output: `<template><bento-date-range-picker model-value="val" /></template>`,
214
- options: [{ autofix: true }],
215
- errors: [{ messageId: 'deprecation' }],
216
- },
217
- // bento-date-range-picker: Shorthand
218
- {
219
- name: 'Invalid: Dynamic prop on bento-date-range-picker',
220
- filename: 'test.vue',
221
- code: `<template><bento-date-range-picker :value="val" /></template>`,
222
- output: `<template><bento-date-range-picker :model-value="val" /></template>`,
223
- options: [{ autofix: true }],
224
- errors: [{ messageId: 'deprecation' }],
225
- },
226
- // bento-dropdown: Static
227
- {
228
- name: 'Invalid: Static prop on bento-dropdown',
229
- filename: 'test.vue',
230
- code: `<template><bento-dropdown value="val" /></template>`,
231
- output: `<template><bento-dropdown model-value="val" /></template>`,
232
- options: [{ autofix: true }],
233
- errors: [{ messageId: 'deprecation' }],
234
- },
235
- // bento-dropdown: Shorthand
236
- {
237
- name: 'Invalid: Dynamic prop on bento-dropdown',
238
- filename: 'test.vue',
239
- code: `<template><bento-dropdown :value="val" /></template>`,
240
- output: `<template><bento-dropdown :model-value="val" /></template>`,
241
- options: [{ autofix: true }],
242
- errors: [{ messageId: 'deprecation' }],
243
- },
244
- // bento-dropdown-avatar: Static
245
- {
246
- name: 'Invalid: Static prop on bento-dropdown-avatar',
247
- filename: 'test.vue',
248
- code: `<template><bento-dropdown-avatar value="val" /></template>`,
249
- output: `<template><bento-dropdown-avatar model-value="val" /></template>`,
250
- options: [{ autofix: true }],
251
- errors: [{ messageId: 'deprecation' }],
252
- },
253
- // bento-dropdown-avatar: Shorthand
254
- {
255
- name: 'Invalid: Dynamic prop on bento-dropdown-avatar',
256
- filename: 'test.vue',
257
- code: `<template><bento-dropdown-avatar :value="val" /></template>`,
258
- output: `<template><bento-dropdown-avatar :model-value="val" /></template>`,
259
- options: [{ autofix: true }],
260
- errors: [{ messageId: 'deprecation' }],
261
- },
262
- // bento-dropdown-country: Static
263
- {
264
- name: 'Invalid: Static prop on bento-dropdown-country',
265
- filename: 'test.vue',
266
- code: `<template><bento-dropdown-country value="val" /></template>`,
267
- output: `<template><bento-dropdown-country model-value="val" /></template>`,
268
- options: [{ autofix: true }],
269
- errors: [{ messageId: 'deprecation' }],
270
- },
271
- // bento-dropdown-country: Shorthand
272
- {
273
- name: 'Invalid: Dynamic prop on bento-dropdown-country',
274
- filename: 'test.vue',
275
- code: `<template><bento-dropdown-country :value="val" /></template>`,
276
- output: `<template><bento-dropdown-country :model-value="val" /></template>`,
277
- options: [{ autofix: true }],
278
- errors: [{ messageId: 'deprecation' }],
279
- },
280
- // bento-dropdown-currency: Static
281
- {
282
- name: 'Invalid: Static prop on bento-dropdown-currency',
283
- filename: 'test.vue',
284
- code: `<template><bento-dropdown-currency value="val" /></template>`,
285
- output: `<template><bento-dropdown-currency model-value="val" /></template>`,
286
- options: [{ autofix: true }],
287
- errors: [{ messageId: 'deprecation' }],
288
- },
289
- // bento-dropdown-currency: Shorthand
290
- {
291
- name: 'Invalid: Dynamic prop on bento-dropdown-currency',
292
- filename: 'test.vue',
293
- code: `<template><bento-dropdown-currency :value="val" /></template>`,
294
- output: `<template><bento-dropdown-currency :model-value="val" /></template>`,
295
- options: [{ autofix: true }],
296
- errors: [{ messageId: 'deprecation' }],
297
- },
298
- // bento-dropdown-payment-method: Static
299
- {
300
- name: 'Invalid: Static prop on bento-dropdown-payment-method',
301
- filename: 'test.vue',
302
- code: `<template><bento-dropdown-payment-method value="val" /></template>`,
303
- output: `<template><bento-dropdown-payment-method model-value="val" /></template>`,
304
- options: [{ autofix: true }],
305
- errors: [{ messageId: 'deprecation' }],
306
- },
307
- // bento-dropdown-payment-method: Shorthand
308
- {
309
- name: 'Invalid: Dynamic prop on bento-dropdown-payment-method',
310
- filename: 'test.vue',
311
- code: `<template><bento-dropdown-payment-method :value="val" /></template>`,
312
- output: `<template><bento-dropdown-payment-method :model-value="val" /></template>`,
313
- options: [{ autofix: true }],
314
- errors: [{ messageId: 'deprecation' }],
315
- },
316
- // bento-dropdown-tag: Static
317
- {
318
- name: 'Invalid: Static prop on bento-dropdown-tag',
319
- filename: 'test.vue',
320
- code: `<template><bento-dropdown-tag value="val" /></template>`,
321
- output: `<template><bento-dropdown-tag model-value="val" /></template>`,
322
- options: [{ autofix: true }],
323
- errors: [{ messageId: 'deprecation' }],
324
- },
325
- // bento-dropdown-tag: Shorthand
326
- {
327
- name: 'Invalid: Dynamic prop on bento-dropdown-tag',
328
- filename: 'test.vue',
329
- code: `<template><bento-dropdown-tag :value="val" /></template>`,
330
- output: `<template><bento-dropdown-tag :model-value="val" /></template>`,
331
- options: [{ autofix: true }],
332
- errors: [{ messageId: 'deprecation' }],
333
- },
334
- // bento-file-uploader: Static
335
- {
336
- name: 'Invalid: Static prop on bento-file-uploader',
337
- filename: 'test.vue',
338
- code: `<template><bento-file-uploader value="val" /></template>`,
339
- output: `<template><bento-file-uploader model-value="val" /></template>`,
340
- options: [{ autofix: true }],
341
- errors: [{ messageId: 'deprecation' }],
342
- },
343
- // bento-file-uploader: Shorthand
344
- {
345
- name: 'Invalid: Dynamic prop on bento-file-uploader',
346
- filename: 'test.vue',
347
- code: `<template><bento-file-uploader :value="val" /></template>`,
348
- output: `<template><bento-file-uploader :model-value="val" /></template>`,
349
- options: [{ autofix: true }],
350
- errors: [{ messageId: 'deprecation' }],
351
- },
352
- // bento-input-field: Static
353
- {
354
- name: 'Invalid: Static prop on bento-input-field',
355
- filename: 'test.vue',
356
- code: `<template><bento-input-field value="val" /></template>`,
357
- output: `<template><bento-input-field model-value="val" /></template>`,
358
- options: [{ autofix: true }],
359
- errors: [{ messageId: 'deprecation' }],
360
- },
361
- // bento-input-field: Shorthand
362
- {
363
- name: 'Invalid: Dynamic prop on bento-input-field',
364
- filename: 'test.vue',
365
- code: `<template><bento-input-field :value="val" /></template>`,
366
- output: `<template><bento-input-field :model-value="val" /></template>`,
367
- options: [{ autofix: true }],
368
- errors: [{ messageId: 'deprecation' }],
369
- },
370
- // bento-input-field-password: Static
371
- {
372
- name: 'Invalid: Static prop on bento-input-field-password',
373
- filename: 'test.vue',
374
- code: `<template><bento-input-field-password value="val" /></template>`,
375
- output: `<template><bento-input-field-password model-value="val" /></template>`,
376
- options: [{ autofix: true }],
377
- errors: [{ messageId: 'deprecation' }],
378
- },
379
- // bento-input-field-password: Shorthand
380
- {
381
- name: 'Invalid: Dynamic prop on bento-input-field-password',
382
- filename: 'test.vue',
383
- code: `<template><bento-input-field-password :value="val" /></template>`,
384
- output: `<template><bento-input-field-password :model-value="val" /></template>`,
385
- options: [{ autofix: true }],
386
- errors: [{ messageId: 'deprecation' }],
387
- },
388
- // bento-input-field-phone-number: Static
389
- {
390
- name: 'Invalid: Static prop on bento-input-field-phone-number',
391
- filename: 'test.vue',
392
- code: `<template><bento-input-field-phone-number value="val" /></template>`,
393
- output: `<template><bento-input-field-phone-number model-value="val" /></template>`,
394
- options: [{ autofix: true }],
395
- errors: [{ messageId: 'deprecation' }],
396
- },
397
- // bento-input-field-phone-number: Shorthand
398
- {
399
- name: 'Invalid: Dynamic prop on bento-input-field-phone-number',
400
- filename: 'test.vue',
401
- code: `<template><bento-input-field-phone-number :value="val" /></template>`,
402
- output: `<template><bento-input-field-phone-number :model-value="val" /></template>`,
403
- options: [{ autofix: true }],
404
- errors: [{ messageId: 'deprecation' }],
405
- },
406
- // bento-checkbox-group: Static
407
- {
408
- name: 'Invalid: Static prop on bento-checkbox-group',
409
- filename: 'test.vue',
410
- code: `<template><bento-checkbox-group value="val" /></template>`,
411
- output: `<template><bento-checkbox-group model-value="val" /></template>`,
412
- options: [{ autofix: true }],
413
- errors: [{ messageId: 'deprecation' }],
414
- },
415
- // bento-checkbox-group: Shorthand
416
- {
417
- name: 'Invalid: Dynamic prop on bento-checkbox-group',
418
- filename: 'test.vue',
419
- code: `<template><bento-checkbox-group :value="val" /></template>`,
420
- output: `<template><bento-checkbox-group :model-value="val" /></template>`,
421
- options: [{ autofix: true }],
422
- errors: [{ messageId: 'deprecation' }],
423
- },
424
- // bento-radio-group: Static
425
- {
426
- name: 'Invalid: Static prop on bento-radio-group',
427
- filename: 'test.vue',
428
- code: `<template><bento-radio-group value="val" /></template>`,
429
- output: `<template><bento-radio-group model-value="val" /></template>`,
430
- options: [{ autofix: true }],
431
- errors: [{ messageId: 'deprecation' }],
432
- },
433
- // bento-radio-group: Shorthand
434
- {
435
- name: 'Invalid: Dynamic prop on bento-radio-group',
436
- filename: 'test.vue',
437
- code: `<template><bento-radio-group :value="val" /></template>`,
438
- output: `<template><bento-radio-group :model-value="val" /></template>`,
439
- options: [{ autofix: true }],
440
- errors: [{ messageId: 'deprecation' }],
441
- },
442
- // bento-selection-card-group: Static
443
- {
444
- name: 'Invalid: Static prop on bento-selection-card-group',
445
- filename: 'test.vue',
446
- code: `<template><bento-selection-card-group value="val" /></template>`,
447
- output: `<template><bento-selection-card-group model-value="val" /></template>`,
448
- options: [{ autofix: true }],
449
- errors: [{ messageId: 'deprecation' }],
450
- },
451
- // bento-selection-card-group: Shorthand
452
- {
453
- name: 'Invalid: Dynamic prop on bento-selection-card-group',
454
- filename: 'test.vue',
455
- code: `<template><bento-selection-card-group :value="val" /></template>`,
456
- output: `<template><bento-selection-card-group :model-value="val" /></template>`,
457
- options: [{ autofix: true }],
458
- errors: [{ messageId: 'deprecation' }],
459
- },
460
- // bento-textarea: Static
461
- {
462
- name: 'Invalid: Static prop on bento-textarea',
463
- filename: 'test.vue',
464
- code: `<template><bento-textarea value="val" /></template>`,
465
- output: `<template><bento-textarea model-value="val" /></template>`,
466
- options: [{ autofix: true }],
467
- errors: [{ messageId: 'deprecation' }],
468
- },
469
- // bento-textarea: Shorthand
470
- {
471
- name: 'Invalid: Dynamic prop on bento-textarea',
472
- filename: 'test.vue',
473
- code: `<template><bento-textarea :value="val" /></template>`,
474
- output: `<template><bento-textarea :model-value="val" /></template>`,
475
- options: [{ autofix: true }],
476
- errors: [{ messageId: 'deprecation' }],
477
- },
478
- ],
479
- });
480
- });
@@ -1,93 +0,0 @@
1
- <template>
2
- <div>
3
- <!-- bento-country: variant="custom" only (warn) -->
4
- <bento-country code="NL" variant="custom" />
5
- <!-- bento-country: label only (warn) -->
6
- <bento-country code="NL" label="Custom label" />
7
- <!-- bento-country: both (warn) -->
8
- <bento-country code="NL" variant="custom" label="Custom label" />
9
-
10
- <!-- bento-dropdown-country: label in items only (warn) -->
11
- <bento-dropdown-country :items="[{ value: 'NL', label: 'Custom label' }]" />
12
- <!-- bento-dropdown-country: variant="custom" only (warn) -->
13
- <bento-dropdown-country :items="[{ value: 'NL' }]" variant="custom" />
14
- <!-- bento-dropdown-country: both (warn) -->
15
- <bento-dropdown-country :items="[{ value: 'NL', label: 'Custom label' }]" variant="custom" />
16
-
17
- <!-- SELECT_COUNTRY filter-bar: label only (warn) -->
18
- <bento-filter-bar
19
- :config="[
20
- {
21
- field: 'c',
22
- label: 'C',
23
- type: BentoFilterItemType.SELECT_COUNTRY,
24
- options: { listboxItems: [{ value: 'NL', label: 'Custom label' }] },
25
- },
26
- ]"
27
- />
28
- <!-- SELECT_COUNTRY filter-bar: variant="custom" only (warn) -->
29
- <bento-filter-bar
30
- :config="[
31
- {
32
- field: 'c',
33
- label: 'C',
34
- type: BentoFilterItemType.SELECT_COUNTRY,
35
- options: { listboxItems: [{ value: 'NL' }], variant: 'custom' },
36
- },
37
- ]"
38
- />
39
- <!-- SELECT_COUNTRY filter-bar: both (warn x2) -->
40
- <bento-filter-bar
41
- :config="[
42
- {
43
- field: 'c',
44
- label: 'C',
45
- type: BentoFilterItemType.SELECT_COUNTRY,
46
- options: { listboxItems: [{ value: 'NL', label: 'Custom label' }], variant: 'custom' },
47
- },
48
- ]"
49
- />
50
-
51
- <!-- SELECT_COUNTRY data-grid: label only (warn) -->
52
- <bento-data-grid
53
- :filters="[
54
- {
55
- field: 'c',
56
- label: 'C',
57
- type: BentoFilterItemType.SELECT_COUNTRY,
58
- options: { listboxItems: [{ value: 'NL', label: 'Custom label' }] },
59
- },
60
- ]"
61
- />
62
- <!-- SELECT_COUNTRY data-grid: variant="custom" only (warn) -->
63
- <bento-data-grid
64
- :filters="[
65
- {
66
- field: 'c',
67
- label: 'C',
68
- type: BentoFilterItemType.SELECT_COUNTRY,
69
- options: { listboxItems: [{ value: 'NL' }], variant: 'custom' },
70
- },
71
- ]"
72
- />
73
- <!-- SELECT_COUNTRY data-grid: both (warn x2) -->
74
- <bento-data-grid
75
- :filters="[
76
- {
77
- field: 'c',
78
- label: 'C',
79
- type: BentoFilterItemType.SELECT_COUNTRY,
80
- options: { listboxItems: [{ value: 'NL', label: 'Custom label' }], variant: 'custom' },
81
- },
82
- ]"
83
- />
84
-
85
- <!-- Valid: non-custom usage -->
86
- <bento-country code="NL" variant="name" />
87
- <bento-dropdown-country :items="[{ value: 'NL' }]" />
88
- </div>
89
- </template>
90
-
91
- <script setup>
92
- import { BentoFilterItemType } from '@adyen/bento-vue2';
93
- </script>
@@ -1,25 +0,0 @@
1
- // eslint.config.js
2
- const { defineConfig } = require('eslint/config');
3
- const vueParser = require('vue-eslint-parser');
4
- const tsParser = require('@typescript-eslint/parser');
5
- const adyenBento = require('@adyen/eslint-plugin-bento');
6
-
7
- module.exports = defineConfig([
8
- {
9
- languageOptions: {
10
- ecmaVersion: 'latest',
11
- sourceType: 'module',
12
- parser: vueParser,
13
- parserOptions: {
14
- parser: tsParser,
15
- },
16
- },
17
- plugins: {
18
- '@adyen/bento': adyenBento,
19
- },
20
- rules: {
21
- '@adyen/bento/deprecation-country-custom-usage': ['warn', { autofix: true }],
22
- },
23
- files: ['**/*.vue'],
24
- },
25
- ]);
@@ -1,22 +0,0 @@
1
- import path from 'node:path';
2
- import { execFileSyncEslintVueFiles } from '../../utils/exec-file-sync-eslint-vue-files';
3
-
4
- describe('@adyen/bento/deprecation-country-custom-usage', () => {
5
- it('should lint with warning', () => {
6
- const eslintrc = path.resolve(__dirname, '__tests__', 'eslint.config.js');
7
- const vueFile = path.resolve(__dirname, '__tests__', 'deprecation-country-custom-usage.vue');
8
-
9
- const result = JSON.parse(execFileSyncEslintVueFiles(eslintrc, vueFile));
10
-
11
- // bento-country: variant only (1) + label only (1) + both (1) = 3
12
- // bento-dropdown-country: label only (1) + variant only (1) + both (1) = 3
13
- // filter-bar: label only (1) + variant only (1) + both (2) = 4
14
- // data-grid: label only (1) + variant only (1) + both (2) = 4
15
- expect(result[0].warningCount).toBe(14);
16
-
17
- expect(result[0].messages[0]).toMatchObject({
18
- ruleId: '@adyen/bento/deprecation-country-custom-usage',
19
- severity: 1,
20
- });
21
- });
22
- });