@adyen/eslint-plugin-bento 2.10.0 → 2.12.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 +24 -0
- package/configs/vue-recommended.js +3 -0
- package/configs/vue-strict.js +3 -0
- package/index.js +3 -0
- package/package.json +2 -2
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/README.md +48 -0
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/__tests__/deprecation-bento-data-grid-cell-action-menu-item-handler.vue +63 -0
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/__tests__/eslint.config.js +26 -0
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/deprecation-bento-data-grid-cell-action-menu-item-handler.integration.test.ts +24 -0
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/deprecation-bento-data-grid-cell-action-menu-item-handler.js +232 -0
- package/rules/deprecation-bento-data-grid-cell-action-menu-item-handler/deprecation-bento-data-grid-cell-action-menu-item-handler.test.ts +116 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/README.md +50 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/deprecation-bento-date-range-picker-has-actions-prop.vue +10 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/eslint.config.js +29 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/remove/deprecation-bento-date-range-picker-has-actions-prop.vue +11 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/__tests__/remove/eslint.config.js +29 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/deprecation-bento-date-range-picker-has-actions-prop.integration.test.ts +47 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/deprecation-bento-date-range-picker-has-actions-prop.js +205 -0
- package/rules/deprecation-bento-date-range-picker-has-actions-prop/deprecation-bento-date-range-picker-has-actions-prop.test.ts +176 -0
- package/rules/deprecation-country-custom-usage/README.md +151 -0
- package/rules/deprecation-country-custom-usage/__tests__/deprecation-country-custom-usage.vue +93 -0
- package/rules/deprecation-country-custom-usage/__tests__/eslint.config.js +25 -0
- package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.integration.test.ts +22 -0
- package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.js +569 -0
- package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.test.ts +380 -0
|
@@ -0,0 +1,93 @@
|
|
|
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>
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
]);
|
package/rules/deprecation-country-custom-usage/deprecation-country-custom-usage.integration.test.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
});
|