@adyen/eslint-plugin-bento 2.8.0 → 2.9.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 (29) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/configs/vue-recommended.js +3 -0
  3. package/configs/vue-strict.js +3 -0
  4. package/index.js +3 -0
  5. package/package.json +1 -1
  6. package/rules/deprecation-bento-dropdown-size-prop/README.md +25 -0
  7. package/rules/deprecation-bento-dropdown-size-prop/__tests__/deprecation-bento-dropdown-size-prop.vue +9 -0
  8. package/rules/deprecation-bento-dropdown-size-prop/__tests__/eslint.config.js +26 -0
  9. package/rules/deprecation-bento-dropdown-size-prop/deprecation-bento-dropdown-size-prop.integration.test.ts +33 -0
  10. package/rules/deprecation-bento-dropdown-size-prop/deprecation-bento-dropdown-size-prop.js +78 -0
  11. package/rules/deprecation-bento-dropdown-size-prop/deprecation-bento-dropdown-size-prop.test.ts +101 -0
  12. package/rules/deprecation-components-error-prop/README.md +43 -0
  13. package/rules/deprecation-components-error-prop/__tests__/deprecation-components-error-prop.vue +17 -0
  14. package/rules/deprecation-components-error-prop/__tests__/eslint.config.js +26 -0
  15. package/rules/deprecation-components-error-prop/deprecation-components-error-prop.integration.test.ts +37 -0
  16. package/rules/deprecation-components-error-prop/deprecation-components-error-prop.js +79 -0
  17. package/rules/deprecation-components-error-prop/deprecation-components-error-prop.test.ts +120 -0
  18. package/rules/deprecation-components-input-emit/__tests__/eslint.config.js +1 -1
  19. package/rules/deprecation-components-input-emit/deprecation-components-input-emit.js +19 -4
  20. package/rules/deprecation-components-input-emit/deprecation-components-input-emit.test.ts +40 -0
  21. package/rules/deprecation-components-value-prop/__tests__/eslint.config.js +1 -1
  22. package/rules/deprecation-components-value-prop/deprecation-components-value-prop.js +24 -7
  23. package/rules/deprecation-components-value-prop/deprecation-components-value-prop.test.ts +56 -0
  24. package/rules/deprecation-filter-bar-deprecated-props/README.md +64 -0
  25. package/rules/deprecation-filter-bar-deprecated-props/__tests__/deprecation-filter-bar-deprecated-props.vue +48 -0
  26. package/rules/deprecation-filter-bar-deprecated-props/__tests__/eslint.config.js +25 -0
  27. package/rules/deprecation-filter-bar-deprecated-props/deprecation-filter-bar-deprecated-props.integration.test.ts +22 -0
  28. package/rules/deprecation-filter-bar-deprecated-props/deprecation-filter-bar-deprecated-props.js +187 -0
  29. package/rules/deprecation-filter-bar-deprecated-props/deprecation-filter-bar-deprecated-props.test.ts +421 -0
@@ -18,7 +18,7 @@ module.exports = defineConfig([
18
18
  },
19
19
  rules: {
20
20
  // Register the specific rule we are testing
21
- '@adyen/bento/deprecation-components-input-emit': 'warn',
21
+ '@adyen/bento/deprecation-components-input-emit': ['warn', { autofix: true }],
22
22
  },
23
23
  files: ['**/*.vue'],
24
24
  },
@@ -22,11 +22,24 @@ module.exports = {
22
22
  deprecation: `The "input" emit is deprecated. Please use "update:model-value" instead.`,
23
23
  },
24
24
  fixable: 'code',
25
- schema: [],
25
+ schema: [
26
+ {
27
+ type: 'object',
28
+ properties: {
29
+ autofix: {
30
+ type: 'boolean',
31
+ default: false,
32
+ },
33
+ },
34
+ additionalProperties: false,
35
+ },
36
+ ],
26
37
  },
27
38
 
28
39
  /** @param {RuleContext} context */
29
40
  create(context) {
41
+ const options = context.options[0] || {};
42
+ const autofix = options.autofix === true;
30
43
  /* ------------------------------------------------ */
31
44
  /* CASE 3: EMIT DEPRECATION (Multiple Components) */
32
45
  /* ------------------------------------------------ */
@@ -38,9 +51,11 @@ module.exports = {
38
51
  context.report({
39
52
  node,
40
53
  messageId: 'deprecation',
41
- fix(fixer) {
42
- return fixer.replaceText(node.key.argument, 'update:model-value');
43
- },
54
+ ...(autofix && {
55
+ fix(fixer) {
56
+ return fixer.replaceText(node.key.argument, 'update:model-value');
57
+ },
58
+ }),
44
59
  });
45
60
  },
46
61
  });
@@ -163,11 +163,36 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
163
163
  },
164
164
  ],
165
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 */
166
190
  {
167
191
  name: 'Invalid: Emit event on bento-date-picker',
168
192
  filename: 'test.vue',
169
193
  code: `<template><bento-date-picker @input="val" /></template>`,
170
194
  output: `<template><bento-date-picker @update:model-value="val" /></template>`,
195
+ options: [{ autofix: true }],
171
196
  errors: [{ messageId: 'deprecation' }],
172
197
  },
173
198
  {
@@ -175,6 +200,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
175
200
  filename: 'test.vue',
176
201
  code: `<template><bento-date-range-picker @input="val" /></template>`,
177
202
  output: `<template><bento-date-range-picker @update:model-value="val" /></template>`,
203
+ options: [{ autofix: true }],
178
204
  errors: [{ messageId: 'deprecation' }],
179
205
  },
180
206
  {
@@ -182,6 +208,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
182
208
  filename: 'test.vue',
183
209
  code: `<template><bento-dropdown @input="val" /></template>`,
184
210
  output: `<template><bento-dropdown @update:model-value="val" /></template>`,
211
+ options: [{ autofix: true }],
185
212
  errors: [{ messageId: 'deprecation' }],
186
213
  },
187
214
  {
@@ -189,6 +216,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
189
216
  filename: 'test.vue',
190
217
  code: `<template><bento-dropdown-avatar @input="val" /></template>`,
191
218
  output: `<template><bento-dropdown-avatar @update:model-value="val" /></template>`,
219
+ options: [{ autofix: true }],
192
220
  errors: [{ messageId: 'deprecation' }],
193
221
  },
194
222
  {
@@ -196,6 +224,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
196
224
  filename: 'test.vue',
197
225
  code: `<template><bento-dropdown-country @input="val" /></template>`,
198
226
  output: `<template><bento-dropdown-country @update:model-value="val" /></template>`,
227
+ options: [{ autofix: true }],
199
228
  errors: [{ messageId: 'deprecation' }],
200
229
  },
201
230
  {
@@ -203,6 +232,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
203
232
  filename: 'test.vue',
204
233
  code: `<template><bento-dropdown-currency @input="val" /></template>`,
205
234
  output: `<template><bento-dropdown-currency @update:model-value="val" /></template>`,
235
+ options: [{ autofix: true }],
206
236
  errors: [{ messageId: 'deprecation' }],
207
237
  },
208
238
  {
@@ -210,6 +240,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
210
240
  filename: 'test.vue',
211
241
  code: `<template><bento-dropdown-payment-method @input="val" /></template>`,
212
242
  output: `<template><bento-dropdown-payment-method @update:model-value="val" /></template>`,
243
+ options: [{ autofix: true }],
213
244
  errors: [{ messageId: 'deprecation' }],
214
245
  },
215
246
  {
@@ -217,6 +248,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
217
248
  filename: 'test.vue',
218
249
  code: `<template><bento-dropdown-tag @input="val" /></template>`,
219
250
  output: `<template><bento-dropdown-tag @update:model-value="val" /></template>`,
251
+ options: [{ autofix: true }],
220
252
  errors: [{ messageId: 'deprecation' }],
221
253
  },
222
254
  {
@@ -224,6 +256,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
224
256
  filename: 'test.vue',
225
257
  code: `<template><bento-file-uploader @input="val" /></template>`,
226
258
  output: `<template><bento-file-uploader @update:model-value="val" /></template>`,
259
+ options: [{ autofix: true }],
227
260
  errors: [{ messageId: 'deprecation' }],
228
261
  },
229
262
  {
@@ -231,6 +264,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
231
264
  filename: 'test.vue',
232
265
  code: `<template><bento-input-field @input="val" /></template>`,
233
266
  output: `<template><bento-input-field @update:model-value="val" /></template>`,
267
+ options: [{ autofix: true }],
234
268
  errors: [{ messageId: 'deprecation' }],
235
269
  },
236
270
  {
@@ -238,6 +272,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
238
272
  filename: 'test.vue',
239
273
  code: `<template><bento-input-field-password @input="val" /></template>`,
240
274
  output: `<template><bento-input-field-password @update:model-value="val" /></template>`,
275
+ options: [{ autofix: true }],
241
276
  errors: [{ messageId: 'deprecation' }],
242
277
  },
243
278
  {
@@ -245,6 +280,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
245
280
  filename: 'test.vue',
246
281
  code: `<template><bento-input-field-phone-number @input="val" /></template>`,
247
282
  output: `<template><bento-input-field-phone-number @update:model-value="val" /></template>`,
283
+ options: [{ autofix: true }],
248
284
  errors: [{ messageId: 'deprecation' }],
249
285
  },
250
286
  {
@@ -252,6 +288,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
252
288
  filename: 'test.vue',
253
289
  code: `<template><bento-checkbox-group @input="val" /></template>`,
254
290
  output: `<template><bento-checkbox-group @update:model-value="val" /></template>`,
291
+ options: [{ autofix: true }],
255
292
  errors: [{ messageId: 'deprecation' }],
256
293
  },
257
294
  {
@@ -259,6 +296,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
259
296
  filename: 'test.vue',
260
297
  code: `<template><bento-radio-group @input="val" /></template>`,
261
298
  output: `<template><bento-radio-group @update:model-value="val" /></template>`,
299
+ options: [{ autofix: true }],
262
300
  errors: [{ messageId: 'deprecation' }],
263
301
  },
264
302
  {
@@ -266,6 +304,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
266
304
  filename: 'test.vue',
267
305
  code: `<template><bento-selection-card-group @input="val" /></template>`,
268
306
  output: `<template><bento-selection-card-group @update:model-value="val" /></template>`,
307
+ options: [{ autofix: true }],
269
308
  errors: [{ messageId: 'deprecation' }],
270
309
  },
271
310
  {
@@ -273,6 +312,7 @@ describe('@adyen/bento/deprecation-components-input-emit', () => {
273
312
  filename: 'test.vue',
274
313
  code: `<template><bento-textarea @input="val" /></template>`,
275
314
  output: `<template><bento-textarea @update:model-value="val" /></template>`,
315
+ options: [{ autofix: true }],
276
316
  errors: [{ messageId: 'deprecation' }],
277
317
  },
278
318
  ],
@@ -18,7 +18,7 @@ module.exports = defineConfig([
18
18
  },
19
19
  rules: {
20
20
  // Register the specific rule we are testing
21
- '@adyen/bento/deprecation-components-value-prop': 'warn',
21
+ '@adyen/bento/deprecation-components-value-prop': ['warn', { autofix: true }],
22
22
  },
23
23
  files: ['**/*.vue'],
24
24
  },
@@ -22,11 +22,24 @@ module.exports = {
22
22
  deprecation: `The "value" prop is deprecated. Please use "model-value" instead.`,
23
23
  },
24
24
  fixable: 'code',
25
- schema: [],
25
+ schema: [
26
+ {
27
+ type: 'object',
28
+ properties: {
29
+ autofix: {
30
+ type: 'boolean',
31
+ default: false,
32
+ },
33
+ },
34
+ additionalProperties: false,
35
+ },
36
+ ],
26
37
  },
27
38
 
28
39
  /** @param {RuleContext} context */
29
40
  create(context) {
41
+ const options = context.options[0] || {};
42
+ const autofix = options.autofix === true;
30
43
  /* ------------------------------------------------ */
31
44
  /* CASE 2: PROP DEPRECATION (Multiple Components) */
32
45
  /* ------------------------------------------------ */
@@ -38,9 +51,11 @@ module.exports = {
38
51
  context.report({
39
52
  node,
40
53
  messageId: 'deprecation',
41
- fix(fixer) {
42
- return fixer.replaceText(node.key, 'model-value');
43
- },
54
+ ...(autofix && {
55
+ fix(fixer) {
56
+ return fixer.replaceText(node.key, 'model-value');
57
+ },
58
+ }),
44
59
  });
45
60
  },
46
61
 
@@ -51,9 +66,11 @@ module.exports = {
51
66
  context.report({
52
67
  node,
53
68
  messageId: 'deprecation',
54
- fix(fixer) {
55
- return fixer.replaceText(node.key.argument, 'model-value');
56
- },
69
+ ...(autofix && {
70
+ fix(fixer) {
71
+ return fixer.replaceText(node.key.argument, 'model-value');
72
+ },
73
+ }),
57
74
  });
58
75
  },
59
76
  });
@@ -163,12 +163,37 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
163
163
  },
164
164
  ],
165
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 */
166
190
  // bento-date-picker: Static
167
191
  {
168
192
  name: 'Invalid: Static prop on bento-date-picker',
169
193
  filename: 'test.vue',
170
194
  code: `<template><bento-date-picker value="val" /></template>`,
171
195
  output: `<template><bento-date-picker model-value="val" /></template>`,
196
+ options: [{ autofix: true }],
172
197
  errors: [{ messageId: 'deprecation' }],
173
198
  },
174
199
  // bento-date-picker: Shorthand
@@ -177,6 +202,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
177
202
  filename: 'test.vue',
178
203
  code: `<template><bento-date-picker :value="val" /></template>`,
179
204
  output: `<template><bento-date-picker :model-value="val" /></template>`,
205
+ options: [{ autofix: true }],
180
206
  errors: [{ messageId: 'deprecation' }],
181
207
  },
182
208
  // bento-date-range-picker: Static
@@ -185,6 +211,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
185
211
  filename: 'test.vue',
186
212
  code: `<template><bento-date-range-picker value="val" /></template>`,
187
213
  output: `<template><bento-date-range-picker model-value="val" /></template>`,
214
+ options: [{ autofix: true }],
188
215
  errors: [{ messageId: 'deprecation' }],
189
216
  },
190
217
  // bento-date-range-picker: Shorthand
@@ -193,6 +220,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
193
220
  filename: 'test.vue',
194
221
  code: `<template><bento-date-range-picker :value="val" /></template>`,
195
222
  output: `<template><bento-date-range-picker :model-value="val" /></template>`,
223
+ options: [{ autofix: true }],
196
224
  errors: [{ messageId: 'deprecation' }],
197
225
  },
198
226
  // bento-dropdown: Static
@@ -201,6 +229,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
201
229
  filename: 'test.vue',
202
230
  code: `<template><bento-dropdown value="val" /></template>`,
203
231
  output: `<template><bento-dropdown model-value="val" /></template>`,
232
+ options: [{ autofix: true }],
204
233
  errors: [{ messageId: 'deprecation' }],
205
234
  },
206
235
  // bento-dropdown: Shorthand
@@ -209,6 +238,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
209
238
  filename: 'test.vue',
210
239
  code: `<template><bento-dropdown :value="val" /></template>`,
211
240
  output: `<template><bento-dropdown :model-value="val" /></template>`,
241
+ options: [{ autofix: true }],
212
242
  errors: [{ messageId: 'deprecation' }],
213
243
  },
214
244
  // bento-dropdown-avatar: Static
@@ -217,6 +247,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
217
247
  filename: 'test.vue',
218
248
  code: `<template><bento-dropdown-avatar value="val" /></template>`,
219
249
  output: `<template><bento-dropdown-avatar model-value="val" /></template>`,
250
+ options: [{ autofix: true }],
220
251
  errors: [{ messageId: 'deprecation' }],
221
252
  },
222
253
  // bento-dropdown-avatar: Shorthand
@@ -225,6 +256,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
225
256
  filename: 'test.vue',
226
257
  code: `<template><bento-dropdown-avatar :value="val" /></template>`,
227
258
  output: `<template><bento-dropdown-avatar :model-value="val" /></template>`,
259
+ options: [{ autofix: true }],
228
260
  errors: [{ messageId: 'deprecation' }],
229
261
  },
230
262
  // bento-dropdown-country: Static
@@ -233,6 +265,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
233
265
  filename: 'test.vue',
234
266
  code: `<template><bento-dropdown-country value="val" /></template>`,
235
267
  output: `<template><bento-dropdown-country model-value="val" /></template>`,
268
+ options: [{ autofix: true }],
236
269
  errors: [{ messageId: 'deprecation' }],
237
270
  },
238
271
  // bento-dropdown-country: Shorthand
@@ -241,6 +274,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
241
274
  filename: 'test.vue',
242
275
  code: `<template><bento-dropdown-country :value="val" /></template>`,
243
276
  output: `<template><bento-dropdown-country :model-value="val" /></template>`,
277
+ options: [{ autofix: true }],
244
278
  errors: [{ messageId: 'deprecation' }],
245
279
  },
246
280
  // bento-dropdown-currency: Static
@@ -249,6 +283,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
249
283
  filename: 'test.vue',
250
284
  code: `<template><bento-dropdown-currency value="val" /></template>`,
251
285
  output: `<template><bento-dropdown-currency model-value="val" /></template>`,
286
+ options: [{ autofix: true }],
252
287
  errors: [{ messageId: 'deprecation' }],
253
288
  },
254
289
  // bento-dropdown-currency: Shorthand
@@ -257,6 +292,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
257
292
  filename: 'test.vue',
258
293
  code: `<template><bento-dropdown-currency :value="val" /></template>`,
259
294
  output: `<template><bento-dropdown-currency :model-value="val" /></template>`,
295
+ options: [{ autofix: true }],
260
296
  errors: [{ messageId: 'deprecation' }],
261
297
  },
262
298
  // bento-dropdown-payment-method: Static
@@ -265,6 +301,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
265
301
  filename: 'test.vue',
266
302
  code: `<template><bento-dropdown-payment-method value="val" /></template>`,
267
303
  output: `<template><bento-dropdown-payment-method model-value="val" /></template>`,
304
+ options: [{ autofix: true }],
268
305
  errors: [{ messageId: 'deprecation' }],
269
306
  },
270
307
  // bento-dropdown-payment-method: Shorthand
@@ -273,6 +310,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
273
310
  filename: 'test.vue',
274
311
  code: `<template><bento-dropdown-payment-method :value="val" /></template>`,
275
312
  output: `<template><bento-dropdown-payment-method :model-value="val" /></template>`,
313
+ options: [{ autofix: true }],
276
314
  errors: [{ messageId: 'deprecation' }],
277
315
  },
278
316
  // bento-dropdown-tag: Static
@@ -281,6 +319,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
281
319
  filename: 'test.vue',
282
320
  code: `<template><bento-dropdown-tag value="val" /></template>`,
283
321
  output: `<template><bento-dropdown-tag model-value="val" /></template>`,
322
+ options: [{ autofix: true }],
284
323
  errors: [{ messageId: 'deprecation' }],
285
324
  },
286
325
  // bento-dropdown-tag: Shorthand
@@ -289,6 +328,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
289
328
  filename: 'test.vue',
290
329
  code: `<template><bento-dropdown-tag :value="val" /></template>`,
291
330
  output: `<template><bento-dropdown-tag :model-value="val" /></template>`,
331
+ options: [{ autofix: true }],
292
332
  errors: [{ messageId: 'deprecation' }],
293
333
  },
294
334
  // bento-file-uploader: Static
@@ -297,6 +337,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
297
337
  filename: 'test.vue',
298
338
  code: `<template><bento-file-uploader value="val" /></template>`,
299
339
  output: `<template><bento-file-uploader model-value="val" /></template>`,
340
+ options: [{ autofix: true }],
300
341
  errors: [{ messageId: 'deprecation' }],
301
342
  },
302
343
  // bento-file-uploader: Shorthand
@@ -305,6 +346,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
305
346
  filename: 'test.vue',
306
347
  code: `<template><bento-file-uploader :value="val" /></template>`,
307
348
  output: `<template><bento-file-uploader :model-value="val" /></template>`,
349
+ options: [{ autofix: true }],
308
350
  errors: [{ messageId: 'deprecation' }],
309
351
  },
310
352
  // bento-input-field: Static
@@ -313,6 +355,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
313
355
  filename: 'test.vue',
314
356
  code: `<template><bento-input-field value="val" /></template>`,
315
357
  output: `<template><bento-input-field model-value="val" /></template>`,
358
+ options: [{ autofix: true }],
316
359
  errors: [{ messageId: 'deprecation' }],
317
360
  },
318
361
  // bento-input-field: Shorthand
@@ -321,6 +364,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
321
364
  filename: 'test.vue',
322
365
  code: `<template><bento-input-field :value="val" /></template>`,
323
366
  output: `<template><bento-input-field :model-value="val" /></template>`,
367
+ options: [{ autofix: true }],
324
368
  errors: [{ messageId: 'deprecation' }],
325
369
  },
326
370
  // bento-input-field-password: Static
@@ -329,6 +373,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
329
373
  filename: 'test.vue',
330
374
  code: `<template><bento-input-field-password value="val" /></template>`,
331
375
  output: `<template><bento-input-field-password model-value="val" /></template>`,
376
+ options: [{ autofix: true }],
332
377
  errors: [{ messageId: 'deprecation' }],
333
378
  },
334
379
  // bento-input-field-password: Shorthand
@@ -337,6 +382,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
337
382
  filename: 'test.vue',
338
383
  code: `<template><bento-input-field-password :value="val" /></template>`,
339
384
  output: `<template><bento-input-field-password :model-value="val" /></template>`,
385
+ options: [{ autofix: true }],
340
386
  errors: [{ messageId: 'deprecation' }],
341
387
  },
342
388
  // bento-input-field-phone-number: Static
@@ -345,6 +391,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
345
391
  filename: 'test.vue',
346
392
  code: `<template><bento-input-field-phone-number value="val" /></template>`,
347
393
  output: `<template><bento-input-field-phone-number model-value="val" /></template>`,
394
+ options: [{ autofix: true }],
348
395
  errors: [{ messageId: 'deprecation' }],
349
396
  },
350
397
  // bento-input-field-phone-number: Shorthand
@@ -353,6 +400,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
353
400
  filename: 'test.vue',
354
401
  code: `<template><bento-input-field-phone-number :value="val" /></template>`,
355
402
  output: `<template><bento-input-field-phone-number :model-value="val" /></template>`,
403
+ options: [{ autofix: true }],
356
404
  errors: [{ messageId: 'deprecation' }],
357
405
  },
358
406
  // bento-checkbox-group: Static
@@ -361,6 +409,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
361
409
  filename: 'test.vue',
362
410
  code: `<template><bento-checkbox-group value="val" /></template>`,
363
411
  output: `<template><bento-checkbox-group model-value="val" /></template>`,
412
+ options: [{ autofix: true }],
364
413
  errors: [{ messageId: 'deprecation' }],
365
414
  },
366
415
  // bento-checkbox-group: Shorthand
@@ -369,6 +418,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
369
418
  filename: 'test.vue',
370
419
  code: `<template><bento-checkbox-group :value="val" /></template>`,
371
420
  output: `<template><bento-checkbox-group :model-value="val" /></template>`,
421
+ options: [{ autofix: true }],
372
422
  errors: [{ messageId: 'deprecation' }],
373
423
  },
374
424
  // bento-radio-group: Static
@@ -377,6 +427,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
377
427
  filename: 'test.vue',
378
428
  code: `<template><bento-radio-group value="val" /></template>`,
379
429
  output: `<template><bento-radio-group model-value="val" /></template>`,
430
+ options: [{ autofix: true }],
380
431
  errors: [{ messageId: 'deprecation' }],
381
432
  },
382
433
  // bento-radio-group: Shorthand
@@ -385,6 +436,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
385
436
  filename: 'test.vue',
386
437
  code: `<template><bento-radio-group :value="val" /></template>`,
387
438
  output: `<template><bento-radio-group :model-value="val" /></template>`,
439
+ options: [{ autofix: true }],
388
440
  errors: [{ messageId: 'deprecation' }],
389
441
  },
390
442
  // bento-selection-card-group: Static
@@ -393,6 +445,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
393
445
  filename: 'test.vue',
394
446
  code: `<template><bento-selection-card-group value="val" /></template>`,
395
447
  output: `<template><bento-selection-card-group model-value="val" /></template>`,
448
+ options: [{ autofix: true }],
396
449
  errors: [{ messageId: 'deprecation' }],
397
450
  },
398
451
  // bento-selection-card-group: Shorthand
@@ -401,6 +454,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
401
454
  filename: 'test.vue',
402
455
  code: `<template><bento-selection-card-group :value="val" /></template>`,
403
456
  output: `<template><bento-selection-card-group :model-value="val" /></template>`,
457
+ options: [{ autofix: true }],
404
458
  errors: [{ messageId: 'deprecation' }],
405
459
  },
406
460
  // bento-textarea: Static
@@ -409,6 +463,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
409
463
  filename: 'test.vue',
410
464
  code: `<template><bento-textarea value="val" /></template>`,
411
465
  output: `<template><bento-textarea model-value="val" /></template>`,
466
+ options: [{ autofix: true }],
412
467
  errors: [{ messageId: 'deprecation' }],
413
468
  },
414
469
  // bento-textarea: Shorthand
@@ -417,6 +472,7 @@ describe('@adyen/bento/deprecation-components-value-prop', () => {
417
472
  filename: 'test.vue',
418
473
  code: `<template><bento-textarea :value="val" /></template>`,
419
474
  output: `<template><bento-textarea :model-value="val" /></template>`,
475
+ options: [{ autofix: true }],
420
476
  errors: [{ messageId: 'deprecation' }],
421
477
  },
422
478
  ],
@@ -0,0 +1,64 @@
1
+ # deprecation-filter-bar-deprecated-props
2
+
3
+ ## Description
4
+
5
+ Deprecates the following props and options in `bento-filter-bar` and `bento-data-grid` filter configs:
6
+
7
+ ### Direct prop on `bento-filter-bar`
8
+
9
+ | Deprecated | Replacement |
10
+ | ---------- | ---------------------------- |
11
+ | `value` | `config` and `filter-values` |
12
+
13
+ ### Nested options in filter config items (`BentoSelectFilterOptions`)
14
+
15
+ | Deprecated | Replacement |
16
+ | --------------------------------------------------- | ------------------------------------------------- |
17
+ | `messages` | None (persistent filter label now uses a counter) |
18
+ | `messagesPersistentButtonLabelPartiallySelectedKey` | None |
19
+ | `messagesPersistentButtonLabelAllSelectedKey` | None |
20
+
21
+ ### `value` on filter config items (`BentoFilterModel`)
22
+
23
+ | Deprecated | Replacement |
24
+ | ---------- | --------------- |
25
+ | `value` | `filter-values` |
26
+
27
+ ## Rule Details
28
+
29
+ ### ❌ Incorrect
30
+
31
+ ```html
32
+ <bento-filter-bar :value="filters" /> <bento-filter-bar v-model="filters" />
33
+ ```
34
+
35
+ ```js
36
+ const config = [
37
+ {
38
+ field: 'status',
39
+ type: 'BentoSelectFilter',
40
+ value: 'active',
41
+ options: {
42
+ messages: { en: { persistentButtonLabelPartiallySelected: 'x' } },
43
+ messagesPersistentButtonLabelPartiallySelectedKey: 'customKey',
44
+ messagesPersistentButtonLabelAllSelectedKey: 'customKey',
45
+ },
46
+ },
47
+ ];
48
+ ```
49
+
50
+ ### ✅ Correct
51
+
52
+ ```html
53
+ <bento-filter-bar :config="config" :filter-values="values" />
54
+ ```
55
+
56
+ ```js
57
+ const config = [
58
+ {
59
+ field: 'status',
60
+ type: 'BentoSelectFilter',
61
+ options: { listboxItems: [] },
62
+ },
63
+ ];
64
+ ```
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div>
3
+ <!-- Direct value prop on bento-filter-bar: 3 warnings -->
4
+ <bento-filter-bar value="val" />
5
+ <bento-filter-bar :value="filters" />
6
+ <bento-filter-bar v-model="filters" />
7
+
8
+ <!-- Script-defined config with deprecated value + options: used below -->
9
+ <bento-filter-bar :config="configWithValue" />
10
+ <bento-data-grid :filters="configWithOptions" />
11
+
12
+ <!-- Inline template config with deprecated options: 1 warning -->
13
+ <bento-filter-bar
14
+ :config="[
15
+ {
16
+ field: 'inline',
17
+ type: 'BentoSelectFilter',
18
+ options: { messages: {} },
19
+ },
20
+ ]"
21
+ />
22
+ </div>
23
+ </template>
24
+
25
+ <script setup>
26
+ // 1 warning (value on config item)
27
+ const configWithValue = [
28
+ {
29
+ field: 'name',
30
+ type: 'BentoInputFilter',
31
+ value: 'test',
32
+ },
33
+ ];
34
+
35
+ // 3 warnings (messages + 2 keys)
36
+ const configWithOptions = [
37
+ {
38
+ field: 'status',
39
+ type: 'BentoSelectFilter',
40
+ options: {
41
+ messages: {},
42
+ messagesPersistentButtonLabelPartiallySelectedKey: 'k1',
43
+ messagesPersistentButtonLabelAllSelectedKey: 'k2',
44
+ listboxItems: [],
45
+ },
46
+ },
47
+ ];
48
+ </script>