@adyen/eslint-plugin-bento 2.23.0 → 2.24.1

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 +23 -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,25 +0,0 @@
1
- const { defineConfig } = require('eslint/config');
2
- const vueParser = require('vue-eslint-parser');
3
- const tsParser = require('@typescript-eslint/parser');
4
- const adyenBento = require('@adyen/eslint-plugin-bento');
5
-
6
- module.exports = defineConfig([
7
- {
8
- languageOptions: {
9
- ecmaVersion: 'latest',
10
- sourceType: 'module',
11
- parser: vueParser,
12
- parserOptions: {
13
- parser: tsParser,
14
- },
15
- },
16
- plugins: {
17
- '@adyen/bento': adyenBento,
18
- },
19
- rules: {
20
- // Register the specific rule we are testing
21
- '@adyen/bento/deprecation-components-input-emit': ['warn', { autofix: true }],
22
- },
23
- files: ['**/*.vue'],
24
- },
25
- ]);
@@ -1,43 +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-components-input-emit', () => {
5
- it('should lint with warning', () => {
6
- // Load .eslintrc
7
- const eslintrc = path.resolve(__dirname, '__tests__', 'eslint.config.js');
8
- // Load the test file generated alongside this one
9
- const vueFile = path.resolve(__dirname, '__tests__', 'deprecation-components-input-emit.vue');
10
-
11
- // Execute the linter
12
- const result = JSON.parse(execFileSyncEslintVueFiles(eslintrc, vueFile));
13
-
14
- /* ------------------------------------------------ */
15
- /* CASE 2: SINGLE REPLACEMENT */
16
- /* ------------------------------------------------ */
17
-
18
- // For emits/slots, we generate 1 example FOR EACH component.
19
- expect(result[0].warningCount).toBe(16);
20
-
21
- // Verify the message structure on the first error found.
22
- // Since the rule is the same for all components, checking the first one confirms the message is correct.
23
- expect(result[0].messages[0]).toMatchObject({
24
- ruleId: '@adyen/bento/deprecation-components-input-emit',
25
- severity: 1,
26
-
27
- messageId: 'deprecation',
28
- message: `The \`input\` emit is deprecated. Please use \`update:model-value\` instead.
29
-
30
- Be wary of undesired side effects and race conditions if \`v-model\` is used in conjunction with \`@input\`.
31
-
32
- Incorrect:
33
- <bento-component v-model="text" @input="onInput" />
34
-
35
- Correct:
36
- <bento-component :model-value="text" @update:model-value="onInput" />`,
37
-
38
- fix: expect.objectContaining({
39
- text: expect.stringContaining('update:model-value'),
40
- }),
41
- });
42
- });
43
- });
@@ -1,320 +0,0 @@
1
- import { RuleTester } from 'eslint';
2
- import vueParser from 'vue-eslint-parser';
3
- import tsParser from '@typescript-eslint/parser';
4
- import deprecationComponentsInputEmit from './deprecation-components-input-emit';
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-input-emit', () => {
18
- ruleTester.run('deprecation-components-input-emit', deprecationComponentsInputEmit, {
19
- valid: [
20
- {
21
- name: 'Valid usage for bento-date-picker',
22
- filename: 'test.vue',
23
- code: `
24
- <template>
25
- <bento-date-picker @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update: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 @update:model-value="val" />
161
- </template>
162
- `,
163
- },
164
- ],
165
- invalid: [
166
- /* autofix: false */
167
- {
168
- name: 'Invalid: Emit event with autofix disabled (explicit false)',
169
- filename: 'test.vue',
170
- code: `<template><bento-input-field @input="val" /></template>`,
171
- output: null,
172
- options: [{ autofix: false }],
173
- errors: [{ messageId: 'deprecation' }],
174
- },
175
- {
176
- name: 'Invalid: Emit event with autofix disabled (no options)',
177
- filename: 'test.vue',
178
- code: `<template><bento-dropdown @input="handleInput" /></template>`,
179
- output: null,
180
- errors: [{ messageId: 'deprecation' }],
181
- },
182
- {
183
- name: 'Invalid: Emit event with v-on directive and autofix disabled',
184
- filename: 'test.vue',
185
- code: `<template><bento-textarea v-on:input="val" /></template>`,
186
- output: null,
187
- errors: [{ messageId: 'deprecation' }],
188
- },
189
- /* autofix: true */
190
- {
191
- name: 'Invalid: Emit event on bento-date-picker',
192
- filename: 'test.vue',
193
- code: `<template><bento-date-picker @input="val" /></template>`,
194
- output: `<template><bento-date-picker @update:model-value="val" /></template>`,
195
- options: [{ autofix: true }],
196
- errors: [{ messageId: 'deprecation' }],
197
- },
198
- {
199
- name: 'Invalid: Emit event on bento-date-range-picker',
200
- filename: 'test.vue',
201
- code: `<template><bento-date-range-picker @input="val" /></template>`,
202
- output: `<template><bento-date-range-picker @update:model-value="val" /></template>`,
203
- options: [{ autofix: true }],
204
- errors: [{ messageId: 'deprecation' }],
205
- },
206
- {
207
- name: 'Invalid: Emit event on bento-dropdown',
208
- filename: 'test.vue',
209
- code: `<template><bento-dropdown @input="val" /></template>`,
210
- output: `<template><bento-dropdown @update:model-value="val" /></template>`,
211
- options: [{ autofix: true }],
212
- errors: [{ messageId: 'deprecation' }],
213
- },
214
- {
215
- name: 'Invalid: Emit event on bento-dropdown-avatar',
216
- filename: 'test.vue',
217
- code: `<template><bento-dropdown-avatar @input="val" /></template>`,
218
- output: `<template><bento-dropdown-avatar @update:model-value="val" /></template>`,
219
- options: [{ autofix: true }],
220
- errors: [{ messageId: 'deprecation' }],
221
- },
222
- {
223
- name: 'Invalid: Emit event on bento-dropdown-country',
224
- filename: 'test.vue',
225
- code: `<template><bento-dropdown-country @input="val" /></template>`,
226
- output: `<template><bento-dropdown-country @update:model-value="val" /></template>`,
227
- options: [{ autofix: true }],
228
- errors: [{ messageId: 'deprecation' }],
229
- },
230
- {
231
- name: 'Invalid: Emit event on bento-dropdown-currency',
232
- filename: 'test.vue',
233
- code: `<template><bento-dropdown-currency @input="val" /></template>`,
234
- output: `<template><bento-dropdown-currency @update:model-value="val" /></template>`,
235
- options: [{ autofix: true }],
236
- errors: [{ messageId: 'deprecation' }],
237
- },
238
- {
239
- name: 'Invalid: Emit event on bento-dropdown-payment-method',
240
- filename: 'test.vue',
241
- code: `<template><bento-dropdown-payment-method @input="val" /></template>`,
242
- output: `<template><bento-dropdown-payment-method @update:model-value="val" /></template>`,
243
- options: [{ autofix: true }],
244
- errors: [{ messageId: 'deprecation' }],
245
- },
246
- {
247
- name: 'Invalid: Emit event on bento-dropdown-tag',
248
- filename: 'test.vue',
249
- code: `<template><bento-dropdown-tag @input="val" /></template>`,
250
- output: `<template><bento-dropdown-tag @update:model-value="val" /></template>`,
251
- options: [{ autofix: true }],
252
- errors: [{ messageId: 'deprecation' }],
253
- },
254
- {
255
- name: 'Invalid: Emit event on bento-file-uploader',
256
- filename: 'test.vue',
257
- code: `<template><bento-file-uploader @input="val" /></template>`,
258
- output: `<template><bento-file-uploader @update:model-value="val" /></template>`,
259
- options: [{ autofix: true }],
260
- errors: [{ messageId: 'deprecation' }],
261
- },
262
- {
263
- name: 'Invalid: Emit event on bento-input-field',
264
- filename: 'test.vue',
265
- code: `<template><bento-input-field @input="val" /></template>`,
266
- output: `<template><bento-input-field @update:model-value="val" /></template>`,
267
- options: [{ autofix: true }],
268
- errors: [{ messageId: 'deprecation' }],
269
- },
270
- {
271
- name: 'Invalid: Emit event on bento-input-field-password',
272
- filename: 'test.vue',
273
- code: `<template><bento-input-field-password @input="val" /></template>`,
274
- output: `<template><bento-input-field-password @update:model-value="val" /></template>`,
275
- options: [{ autofix: true }],
276
- errors: [{ messageId: 'deprecation' }],
277
- },
278
- {
279
- name: 'Invalid: Emit event on bento-input-field-phone-number',
280
- filename: 'test.vue',
281
- code: `<template><bento-input-field-phone-number @input="val" /></template>`,
282
- output: `<template><bento-input-field-phone-number @update:model-value="val" /></template>`,
283
- options: [{ autofix: true }],
284
- errors: [{ messageId: 'deprecation' }],
285
- },
286
- {
287
- name: 'Invalid: Emit event on bento-checkbox-group',
288
- filename: 'test.vue',
289
- code: `<template><bento-checkbox-group @input="val" /></template>`,
290
- output: `<template><bento-checkbox-group @update:model-value="val" /></template>`,
291
- options: [{ autofix: true }],
292
- errors: [{ messageId: 'deprecation' }],
293
- },
294
- {
295
- name: 'Invalid: Emit event on bento-radio-group',
296
- filename: 'test.vue',
297
- code: `<template><bento-radio-group @input="val" /></template>`,
298
- output: `<template><bento-radio-group @update:model-value="val" /></template>`,
299
- options: [{ autofix: true }],
300
- errors: [{ messageId: 'deprecation' }],
301
- },
302
- {
303
- name: 'Invalid: Emit event on bento-selection-card-group',
304
- filename: 'test.vue',
305
- code: `<template><bento-selection-card-group @input="val" /></template>`,
306
- output: `<template><bento-selection-card-group @update:model-value="val" /></template>`,
307
- options: [{ autofix: true }],
308
- errors: [{ messageId: 'deprecation' }],
309
- },
310
- {
311
- name: 'Invalid: Emit event on bento-textarea',
312
- filename: 'test.vue',
313
- code: `<template><bento-textarea @input="val" /></template>`,
314
- output: `<template><bento-textarea @update:model-value="val" /></template>`,
315
- options: [{ autofix: true }],
316
- errors: [{ messageId: 'deprecation' }],
317
- },
318
- ],
319
- });
320
- });
@@ -1,69 +0,0 @@
1
- <template>
2
- <div>
3
- <bento-date-picker value="value" />
4
- <bento-date-picker :value="value" />
5
- <bento-date-picker :value="value" />
6
-
7
- <bento-date-range-picker value="value" />
8
- <bento-date-range-picker :value="value" />
9
- <bento-date-range-picker :value="value" />
10
-
11
- <bento-dropdown value="value" />
12
- <bento-dropdown :value="value" />
13
- <bento-dropdown :value="value" />
14
-
15
- <bento-dropdown-avatar value="value" />
16
- <bento-dropdown-avatar :value="value" />
17
- <bento-dropdown-avatar :value="value" />
18
-
19
- <bento-dropdown-country value="value" />
20
- <bento-dropdown-country :value="value" />
21
- <bento-dropdown-country :value="value" />
22
-
23
- <bento-dropdown-currency value="value" />
24
- <bento-dropdown-currency :value="value" />
25
- <bento-dropdown-currency :value="value" />
26
-
27
- <bento-dropdown-payment-method value="value" />
28
- <bento-dropdown-payment-method :value="value" />
29
- <bento-dropdown-payment-method :value="value" />
30
-
31
- <bento-dropdown-tag value="value" />
32
- <bento-dropdown-tag :value="value" />
33
- <bento-dropdown-tag :value="value" />
34
-
35
- <bento-file-uploader value="value" />
36
- <bento-file-uploader :value="value" />
37
- <bento-file-uploader :value="value" />
38
-
39
- <bento-input-field value="value" />
40
- <bento-input-field :value="value" />
41
- <bento-input-field :value="value" />
42
-
43
- <bento-input-field-password value="value" />
44
- <bento-input-field-password :value="value" />
45
- <bento-input-field-password :value="value" />
46
-
47
- <bento-input-field-phone-number value="value" />
48
- <bento-input-field-phone-number :value="value" />
49
- <bento-input-field-phone-number :value="value" />
50
-
51
- <bento-checkbox-group value="value" />
52
- <bento-checkbox-group :value="value" />
53
- <bento-checkbox-group :value="value" />
54
-
55
- <bento-radio-group value="value" />
56
- <bento-radio-group :value="value" />
57
- <bento-radio-group :value="value" />
58
-
59
- <bento-selection-card-group value="value" />
60
- <bento-selection-card-group :value="value" />
61
- <bento-selection-card-group :value="value" />
62
-
63
- <bento-textarea value="value" />
64
- <bento-textarea :value="value" />
65
- <bento-textarea :value="value" />
66
- </div>
67
- </template>
68
-
69
- <script setup></script>
@@ -1,25 +0,0 @@
1
- const { defineConfig } = require('eslint/config');
2
- const vueParser = require('vue-eslint-parser');
3
- const tsParser = require('@typescript-eslint/parser');
4
- const adyenBento = require('@adyen/eslint-plugin-bento');
5
-
6
- module.exports = defineConfig([
7
- {
8
- languageOptions: {
9
- ecmaVersion: 'latest',
10
- sourceType: 'module',
11
- parser: vueParser,
12
- parserOptions: {
13
- parser: tsParser,
14
- },
15
- },
16
- plugins: {
17
- '@adyen/bento': adyenBento,
18
- },
19
- rules: {
20
- // Register the specific rule we are testing
21
- '@adyen/bento/deprecation-components-value-prop': ['warn', { autofix: true }],
22
- },
23
- files: ['**/*.vue'],
24
- },
25
- ]);
@@ -1,37 +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-components-value-prop', () => {
5
- it('should lint with warning', () => {
6
- // Load .eslintrc
7
- const eslintrc = path.resolve(__dirname, '__tests__', 'eslint.config.js');
8
- // Load the test file generated alongside this one
9
- const vueFile = path.resolve(__dirname, '__tests__', 'deprecation-components-value-prop.vue');
10
-
11
- // Execute the linter
12
- const result = JSON.parse(execFileSyncEslintVueFiles(eslintrc, vueFile));
13
-
14
- /* ------------------------------------------------ */
15
- /* CASE 2: SINGLE REPLACEMENT */
16
- /* ------------------------------------------------ */
17
-
18
- // For props, we generate 3 examples (static, shorthand, longhand) FOR EACH component.
19
- // Total = (Number of Components) * 3
20
- const numberOfComponents = 16;
21
- expect(result[0].warningCount).toBe(numberOfComponents * 3);
22
-
23
- // Verify the message structure on the first error found.
24
- // Since the rule is the same for all components, checking the first one confirms the message is correct.
25
- expect(result[0].messages[0]).toMatchObject({
26
- ruleId: '@adyen/bento/deprecation-components-value-prop',
27
- severity: 1,
28
-
29
- messageId: 'deprecation',
30
- message: `The "value" prop is deprecated. Please use "model-value" instead.`,
31
-
32
- fix: expect.objectContaining({
33
- text: expect.stringContaining('model-value'),
34
- }),
35
- });
36
- });
37
- });