@adyen/eslint-plugin-bento 2.20.0 → 2.22.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.22.0 (2026-07-29)
4
+
5
+ ### Bug Fixes
6
+
7
+ - removed autofix from `deprecation-filter-bar-values` eslint ([b1a22af27](https://github.com/Adyen/bento/commit/b1a22af27))
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - erice
12
+
13
+
14
+ ## 2.21.0 (2026-07-21)
15
+
16
+ This was a version bump only for eslint to align it with other projects, there were no code changes.
17
+
18
+
3
19
  ## 2.20.0 (2026-07-15)
4
20
 
5
21
  ### Miscellaneous Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/eslint-plugin-bento",
3
- "version": "2.20.0",
3
+ "version": "2.22.0",
4
4
  "description": "Adyen Bento ESLint rules",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -14,6 +14,7 @@
14
14
  :config="[
15
15
  {
16
16
  field: 'inline',
17
+ label: 'Inline',
17
18
  type: 'BentoSelectFilter',
18
19
  options: { messages: {} },
19
20
  },
@@ -27,6 +28,7 @@
27
28
  const configWithValue = [
28
29
  {
29
30
  field: 'name',
31
+ label: 'Name',
30
32
  type: 'BentoInputFilter',
31
33
  value: 'test',
32
34
  },
@@ -36,6 +38,7 @@
36
38
  const configWithOptions = [
37
39
  {
38
40
  field: 'status',
41
+ label: 'Status',
39
42
  type: 'BentoSelectFilter',
40
43
  options: {
41
44
  messages: {},
@@ -46,3 +49,14 @@
46
49
  },
47
50
  ];
48
51
  </script>
52
+
53
+ <script>
54
+ export const parseBinaryOperation = operation => ({
55
+ field: operation.left.name,
56
+ operator: operation.type,
57
+ category: operation.left.type,
58
+ type: parseOperationValueType(operation.right.type),
59
+ value: parseOperationValue(operation),
60
+ key: getUniqueId(),
61
+ });
62
+ </script>
@@ -85,7 +85,12 @@ module.exports = {
85
85
  }
86
86
 
87
87
  // Only check objects that look like filter config items (BentoFilterModel)
88
- const isFilterConfig = propertyMap.field && propertyMap.type;
88
+ const filterType = propertyMap.type?.value;
89
+ const isFilterConfig =
90
+ propertyMap.field &&
91
+ filterType?.type === 'Literal' &&
92
+ typeof filterType.value === 'string' &&
93
+ filterType.value.endsWith('Filter');
89
94
  if (!isFilterConfig) {
90
95
  return;
91
96
  }
@@ -95,11 +100,6 @@ module.exports = {
95
100
  context.report({
96
101
  node: propertyMap.value.key,
97
102
  messageId: 'deprecationConfigValue',
98
- ...(autofix && {
99
- fix(fixer) {
100
- return removeProperty(fixer, node, propertyMap.value);
101
- },
102
- }),
103
103
  });
104
104
  }
105
105
 
@@ -144,11 +144,6 @@ module.exports = {
144
144
  context.report({
145
145
  node,
146
146
  messageId: 'deprecationValue',
147
- ...(autofix && {
148
- fix(fixer) {
149
- return fixer.remove(node);
150
- },
151
- }),
152
147
  });
153
148
  },
154
149
  // Direct "value" prop on bento-filter-bar (dynamic)
@@ -158,25 +153,19 @@ module.exports = {
158
153
  context.report({
159
154
  node,
160
155
  messageId: 'deprecationValue',
161
- ...(autofix && {
162
- fix(fixer) {
163
- return fixer.remove(node);
164
- },
165
- }),
166
156
  });
167
157
  },
168
- // v-model on bento-filter-bar (v-model binds to "value" in Vue 2)
158
+ // Bare v-model binds to "value" in Vue 2; v-model:value does the same in Vue 3
169
159
  [`VElement[name="bento-filter-bar"] > VStartTag > VAttribute[directive=true][key.name.name="model"]`](
170
160
  node
171
161
  ) {
162
+ if (node.key.argument && node.key.argument.name !== 'value') {
163
+ return;
164
+ }
165
+
172
166
  context.report({
173
167
  node,
174
168
  messageId: 'deprecationValue',
175
- ...(autofix && {
176
- fix(fixer) {
177
- return fixer.remove(node);
178
- },
179
- }),
180
169
  });
181
170
  },
182
171
  ...objectVisitor,
@@ -26,6 +26,15 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
26
26
  </template>
27
27
  `,
28
28
  },
29
+ {
30
+ name: 'Valid: Vue 3 filter-values v-model on bento-filter-bar',
31
+ filename: 'test.vue',
32
+ code: `
33
+ <template>
34
+ <bento-filter-bar :config="config" v-model:filter-values="filterValues" />
35
+ </template>
36
+ `,
37
+ },
29
38
  {
30
39
  name: 'Valid: filter config item without deprecated value property',
31
40
  filename: 'test.vue',
@@ -97,6 +106,33 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
97
106
  <template><div /></template>
98
107
  `,
99
108
  },
109
+ {
110
+ name: 'Valid: unrelated binary operation object with field, type, and value properties',
111
+ filename: 'test.vue',
112
+ code: `
113
+ <script>
114
+ export const parseBinaryOperation = operation => ({
115
+ field: operation.left.name,
116
+ operator: operation.type,
117
+ category: operation.left.type,
118
+ type: parseOperationValueType(operation.right.type),
119
+ value: parseOperationValue(operation),
120
+ key: getUniqueId(),
121
+ });
122
+ </script>
123
+ <template><div /></template>
124
+ `,
125
+ },
126
+ {
127
+ name: 'Valid: unrelated object with a non-filter string type',
128
+ filename: 'test.vue',
129
+ code: `
130
+ <script setup>
131
+ const operation = { field: 'name', type: 'BinaryOperation', value: 'test' };
132
+ </script>
133
+ <template><div /></template>
134
+ `,
135
+ },
100
136
  {
101
137
  name: 'Valid: unrelated object with value property (no false positive)',
102
138
  filename: 'test.vue',
@@ -128,9 +164,15 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
128
164
  code: `<template><bento-filter-bar v-model="filters" /></template>`,
129
165
  errors: [{ messageId: 'deprecationValue' }],
130
166
  },
167
+ {
168
+ name: 'Invalid: Vue 3 value v-model on bento-filter-bar',
169
+ filename: 'test.vue',
170
+ code: `<template><bento-filter-bar v-model:value="filters" /></template>`,
171
+ errors: [{ messageId: 'deprecationValue' }],
172
+ },
131
173
  // "value" inside filter config items (script)
132
174
  {
133
- name: 'Invalid: value property in filter config item (script)',
175
+ name: 'Invalid: value property in filter config item without a label',
134
176
  filename: 'test.vue',
135
177
  code: `
136
178
  <script setup>
@@ -150,7 +192,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
150
192
  filename: 'test.vue',
151
193
  code: `
152
194
  <template>
153
- <bento-filter-bar :config="[{ field: 'name', type: 'BentoInputFilter', value: 'test' }]" />
195
+ <bento-filter-bar :config="[{ field: 'name', label: 'Name', type: 'BentoInputFilter', value: 'test' }]" />
154
196
  </template>
155
197
  `,
156
198
  errors: [{ messageId: 'deprecationConfigValue' }],
@@ -163,6 +205,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
163
205
  <script setup>
164
206
  const config = [{
165
207
  field: 'status',
208
+ label: 'Status',
166
209
  type: 'BentoSelectFilter',
167
210
  options: { messages: { en: { persistentButtonLabelPartiallySelected: 'x' } }, listboxItems: [] },
168
211
  }];
@@ -179,6 +222,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
179
222
  <script setup>
180
223
  const config = [{
181
224
  field: 'status',
225
+ label: 'Status',
182
226
  type: 'BentoSelectFilter',
183
227
  options: { messagesPersistentButtonLabelPartiallySelectedKey: 'customKey', listboxItems: [] },
184
228
  }];
@@ -200,6 +244,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
200
244
  <script setup>
201
245
  const config = [{
202
246
  field: 'status',
247
+ label: 'Status',
203
248
  type: 'BentoSelectFilter',
204
249
  options: { messagesPersistentButtonLabelAllSelectedKey: 'customKey', listboxItems: [] },
205
250
  }];
@@ -218,6 +263,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
218
263
  <script setup>
219
264
  const config = [{
220
265
  field: 'status',
266
+ label: 'Status',
221
267
  type: 'BentoSelectFilter',
222
268
  options: {
223
269
  messages: {},
@@ -246,6 +292,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
246
292
  <script setup>
247
293
  const config = [{
248
294
  field: 'status',
295
+ label: 'Status',
249
296
  type: 'BentoSelectFilter',
250
297
  options: { 'messages': {} },
251
298
  }];
@@ -262,6 +309,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
262
309
  <script setup>
263
310
  const filters = [{
264
311
  field: 'name',
312
+ label: 'Name',
265
313
  type: 'BentoInputFilter',
266
314
  value: 'test',
267
315
  }];
@@ -278,6 +326,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
278
326
  <script setup>
279
327
  const filters = [{
280
328
  field: 'status',
329
+ label: 'Status',
281
330
  type: 'BentoSelectFilter',
282
331
  options: { messages: {}, listboxItems: [] },
283
332
  }];
@@ -294,6 +343,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
294
343
  <template>
295
344
  <bento-filter-bar :config="[{
296
345
  field: 'status',
346
+ label: 'Status',
297
347
  type: 'BentoSelectFilter',
298
348
  options: { messages: {}, listboxItems: [] },
299
349
  }]" />
@@ -310,6 +360,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
310
360
  const defaults = {};
311
361
  const config = [{
312
362
  field: 'status',
363
+ label: 'Status',
313
364
  type: 'BentoSelectFilter',
314
365
  options: { ...defaults, messages: {} },
315
366
  }];
@@ -335,52 +386,45 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
335
386
  ],
336
387
  invalid: [
337
388
  {
338
- name: 'Autofix: removes static value prop from bento-filter-bar',
389
+ name: 'Autofix: preserves static value prop on bento-filter-bar',
339
390
  filename: 'test.vue',
340
391
  options: [{ autofix: true }],
341
392
  code: `<template><bento-filter-bar value="val" /></template>`,
342
- output: `<template><bento-filter-bar /></template>`,
393
+ output: null,
343
394
  errors: [{ messageId: 'deprecationValue' }],
344
395
  },
345
396
  {
346
- name: 'Autofix: removes dynamic value prop from bento-filter-bar',
397
+ name: 'Autofix: preserves dynamic value prop on bento-filter-bar',
347
398
  filename: 'test.vue',
348
399
  options: [{ autofix: true }],
349
400
  code: `<template><bento-filter-bar :value="filters" /></template>`,
350
- output: `<template><bento-filter-bar /></template>`,
401
+ output: null,
351
402
  errors: [{ messageId: 'deprecationValue' }],
352
403
  },
353
404
  {
354
- name: 'Autofix: removes v-model from bento-filter-bar',
405
+ name: 'Autofix: preserves v-model on bento-filter-bar',
355
406
  filename: 'test.vue',
356
407
  options: [{ autofix: true }],
357
408
  code: `<template><bento-filter-bar v-model="filters" /></template>`,
358
- output: `<template><bento-filter-bar /></template>`,
409
+ output: null,
359
410
  errors: [{ messageId: 'deprecationValue' }],
360
411
  },
361
412
  {
362
- name: 'Autofix: removes value from filter config item',
413
+ name: 'Autofix: preserves value on filter config item',
363
414
  filename: 'test.vue',
364
415
  options: [{ autofix: true }],
365
416
  code: `
366
417
  <script setup>
367
418
  const config = [{
368
419
  field: 'name',
420
+ label: 'Name',
369
421
  type: 'BentoInputFilter',
370
422
  value: 'test',
371
423
  }];
372
424
  </script>
373
425
  <template><bento-filter-bar :config="config" /></template>
374
426
  `,
375
- output: `
376
- <script setup>
377
- const config = [{
378
- field: 'name',
379
- type: 'BentoInputFilter',
380
- }];
381
- </script>
382
- <template><bento-filter-bar :config="config" /></template>
383
- `,
427
+ output: null,
384
428
  errors: [{ messageId: 'deprecationConfigValue' }],
385
429
  },
386
430
  {
@@ -391,6 +435,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
391
435
  <script setup>
392
436
  const config = [{
393
437
  field: 'status',
438
+ label: 'Status',
394
439
  type: 'BentoSelectFilter',
395
440
  options: { messages: {}, listboxItems: [] },
396
441
  }];
@@ -401,6 +446,7 @@ describe('@adyen/bento/deprecation-filter-bar-deprecated-props', () => {
401
446
  <script setup>
402
447
  const config = [{
403
448
  field: 'status',
449
+ label: 'Status',
404
450
  type: 'BentoSelectFilter',
405
451
  options: { listboxItems: [] },
406
452
  }];