@hero-design/eslint-plugin 9.0.0-0 → 9.0.1-rc2.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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @hero-design/eslint-plugin
|
|
2
|
+
|
|
3
|
+
## 9.0.1-rc2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`96d0a79e0`](https://github.com/Thinkei/hero-design/commit/96d0a79e008db83c915bbadc8d70a5403d6bd4e3) Thanks [@ttkien](https://github.com/ttkien)! - add pre-commit
|
|
8
|
+
|
|
9
|
+
- [#2647](https://github.com/Thinkei/hero-design/pull/2647) [`35fcc3812`](https://github.com/Thinkei/hero-design/commit/35fcc3812a090140848c80ed8d5f39026c4c5ee2) Thanks [@ttkien](https://github.com/ttkien)! - yarn install after bump version
|
|
10
|
+
|
|
11
|
+
## 9.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [#2563](https://github.com/Thinkei/hero-design/pull/2563) [`0254e47a8`](https://github.com/Thinkei/hero-design/commit/0254e47a838f0f431c3d72306b945247786ea7d1) Thanks [@luanlai2201](https://github.com/luanlai2201)! - [Internal] Remove eslint no-invalid-access-theme rule
|
|
16
|
+
|
|
17
|
+
## 8.42.5
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#2302](https://github.com/Thinkei/hero-design/pull/2302) [`2293190d1`](https://github.com/Thinkei/hero-design/commit/2293190d105fb97dc699e39990c3148f3509fafb) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - Upgrade expo sdk and react-native version
|
package/lib/index.js
CHANGED
|
@@ -14,213 +14,6 @@ const requireIndex = require('requireindex');
|
|
|
14
14
|
// Plugin Definition
|
|
15
15
|
//------------------------------------------------------------------------------
|
|
16
16
|
|
|
17
|
-
const themeKeysMap = [
|
|
18
|
-
{
|
|
19
|
-
old: 'colors.globalPrimary',
|
|
20
|
-
new: 'colors.onDefaultGlobalSurface',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
old: 'colors.globalPrimaryLight',
|
|
24
|
-
new: 'colors.globalPrimaryLight',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
old: 'colors.globalPrimaryBackground',
|
|
28
|
-
new: 'colors.defaultGlobalSurface',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
old: 'colors.primaryLight',
|
|
32
|
-
new: 'colors.secondary',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
old: 'colors.primaryDark',
|
|
36
|
-
new: 'colors.primary',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
old: 'colors.primaryBackground',
|
|
40
|
-
new: 'colors.highlightedSurface',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
old: 'colors.primaryBackgroundDark',
|
|
44
|
-
new: 'colors.mutedOnDefaultGlobalSurface',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
old: 'colors.secondaryLight',
|
|
48
|
-
new: 'colors.secondaryLight',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
old: 'colors.secondaryBackground',
|
|
52
|
-
new: 'colors.secondaryBackground',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
old: 'colors.infoMediumLight',
|
|
56
|
-
new: 'colors.mutedInfo',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
old: 'colors.infoLight',
|
|
60
|
-
new: 'colors.mutedInfo',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
old: 'colors.infoBackground',
|
|
64
|
-
new: 'colors.infoSurface',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
old: 'colors.successLight',
|
|
68
|
-
new: 'colors.mutedSuccess',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
old: 'colors.successDark',
|
|
72
|
-
new: 'colors.success',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
old: 'colors.successBackground',
|
|
76
|
-
new: 'colors.successSurface',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
old: 'colors.danger',
|
|
80
|
-
new: 'colors.error',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
old: 'colors.dangerMediumLight',
|
|
84
|
-
new: 'colors.mutedError',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
old: 'colors.dangerLight',
|
|
88
|
-
new: 'colors.mutedError',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
old: 'colors.dangerBackground',
|
|
92
|
-
new: 'colors.errorSurface',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
old: 'colors.warningLight',
|
|
96
|
-
new: 'colors.mutedWarning',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
old: 'colors.warningDark',
|
|
100
|
-
new: 'colors.warning',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
old: 'colors.warningBackground',
|
|
104
|
-
new: 'colors.warningSurface',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
old: 'colors.platformBackground',
|
|
108
|
-
new: 'colors.defaultGlobalSurface',
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
old: 'colors.backgroundLight',
|
|
112
|
-
new: 'colors.neutralGlobalSurface',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
old: 'colors.backgroundDark',
|
|
116
|
-
new: 'colors.darkGlobalSurface',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
old: 'colors.text',
|
|
120
|
-
new: 'colors.onDefaultGlobalSurface',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
old: 'colors.subduedText',
|
|
124
|
-
new: 'colors.mutedOnDefaultGlobalSurface',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
old: 'colors.disabledText',
|
|
128
|
-
new: 'colors.inactiveOnDefaultGlobalSurface',
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
old: 'colors.disabledLightText',
|
|
132
|
-
new: 'colors.disabledOnDefaultGlobalSurface',
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
old: 'colors.invertedText',
|
|
136
|
-
new: 'colors.onDarkGlobalSurface',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
old: 'colors.outline',
|
|
140
|
-
new: 'colors.secondaryOutline',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
old: 'colors.archivedLight',
|
|
144
|
-
new: 'colors.disabledOnDefaultGlobalSurface',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
old: 'colors.archivedDark',
|
|
148
|
-
new: 'colors.archived',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
old: 'colors.archivedBackground',
|
|
152
|
-
new: 'colors.archivedSurface',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
old: 'colors.black',
|
|
156
|
-
new: 'colors.onDefaultGlobalSurface',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
old: 'colors.inactiveBackground',
|
|
160
|
-
new: 'colors.inactiveOnDefaultGlobalSurface',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
old: 'colors.shadow',
|
|
164
|
-
new: 'colors.secondaryOutline',
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
old: 'colors.mutedGlobalPrimary',
|
|
168
|
-
new: 'colors.mutedOnDefaultGlobalSurface',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
old: 'colors.onGlobalPrimary',
|
|
172
|
-
new: 'colors.onDefaultGlobalSurface',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
old: 'colors.globalSecondary',
|
|
176
|
-
new: 'colors.secondary',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
old: 'colors.globalPrimaryOutline',
|
|
180
|
-
new: 'colors.primaryOutline',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
old: 'colors.globalSecondaryOutline',
|
|
184
|
-
new: 'colors.secondaryOutline',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
old: 'colors.mutedPrimary',
|
|
188
|
-
new: 'colors.mutedPrimary',
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
old: 'colors.highlightedSecondarySurface',
|
|
192
|
-
new: 'colors.highlightedSecondarySurface',
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
old: 'colors.mutedSecondary',
|
|
196
|
-
new: 'colors.mutedSecondary',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
old: 'colors.disabledSecondary',
|
|
200
|
-
new: 'colors.disabledSecondary',
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
old: 'colors.lightHighlightedSurface',
|
|
204
|
-
new: 'colors.highlightedSurface',
|
|
205
|
-
},
|
|
206
|
-
];
|
|
207
|
-
const deprecatedThemeColors = themeKeysMap.map((c) => c.old.split('.')[1]);
|
|
208
|
-
const boxColorProps = [
|
|
209
|
-
'backgroundColor',
|
|
210
|
-
'bgColor',
|
|
211
|
-
'borderColor',
|
|
212
|
-
'borderTopColor',
|
|
213
|
-
'borderBottomColor',
|
|
214
|
-
'borderStartColor',
|
|
215
|
-
'borderEndColor',
|
|
216
|
-
'borderLeftColor',
|
|
217
|
-
'borderRightColor',
|
|
218
|
-
];
|
|
219
|
-
const deprecatedBoxPropValues = boxColorProps.map((prop) => ({
|
|
220
|
-
name: prop,
|
|
221
|
-
values: deprecatedThemeColors,
|
|
222
|
-
}));
|
|
223
|
-
|
|
224
17
|
// import all rules in lib/rules
|
|
225
18
|
module.exports = {
|
|
226
19
|
rules: requireIndex(__dirname + '/rules'),
|
|
@@ -228,101 +21,18 @@ module.exports = {
|
|
|
228
21
|
internalRn: {
|
|
229
22
|
plugins: ['@hero-design'],
|
|
230
23
|
rules: {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
keys: themeKeysMap,
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
'@hero-design/no-deprecated-component-prop': [
|
|
238
|
-
'error',
|
|
239
|
-
{
|
|
240
|
-
package: '@hero-design/rn',
|
|
241
|
-
components: [
|
|
242
|
-
{ name: 'Card', props: ['variant'] },
|
|
243
|
-
{ name: 'Switch', props: ['size'] },
|
|
244
|
-
{
|
|
245
|
-
name: 'Select',
|
|
246
|
-
props: ['onDimiss', 'numberOfLines', 'inputProps.required'],
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
name: 'Select.Multi',
|
|
250
|
-
props: ['onDimiss', 'numberOfLines', 'inputProps.required'],
|
|
251
|
-
},
|
|
252
|
-
{ name: 'Toast.Provider', props: ['position'] },
|
|
253
|
-
],
|
|
254
|
-
},
|
|
255
|
-
],
|
|
256
|
-
'@hero-design/no-deprecated-component-prop-value': [
|
|
257
|
-
'error',
|
|
24
|
+
// Rules for the next major version
|
|
25
|
+
'@hero-design/no-deprecated-component-prop-next': [
|
|
26
|
+
'warn',
|
|
258
27
|
{
|
|
259
28
|
package: '@hero-design/rn',
|
|
260
29
|
components: [
|
|
30
|
+
{ name: 'Tag', props: ['variant'] },
|
|
31
|
+
{ name: 'FAB.ActionGroup', props: ['headerTitle'] },
|
|
32
|
+
{ name: 'Checkbox', props: ['withBorder'] },
|
|
261
33
|
{
|
|
262
|
-
name: '
|
|
263
|
-
props: [
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: 'Button',
|
|
267
|
-
props: [{ name: 'variant', values: ['basic-transparent'] }],
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: 'Button.Icon',
|
|
271
|
-
props: [
|
|
272
|
-
{
|
|
273
|
-
name: 'icon',
|
|
274
|
-
values: [
|
|
275
|
-
'carat-down-small',
|
|
276
|
-
'carat-down',
|
|
277
|
-
'carat-left-small',
|
|
278
|
-
'carat-left',
|
|
279
|
-
'carat-right-small',
|
|
280
|
-
'carat-right',
|
|
281
|
-
'carat-up-small',
|
|
282
|
-
'carat-up',
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
],
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
name: 'Button.Utility',
|
|
289
|
-
props: [
|
|
290
|
-
{
|
|
291
|
-
name: 'icon',
|
|
292
|
-
values: [
|
|
293
|
-
'carat-down-small',
|
|
294
|
-
'carat-down',
|
|
295
|
-
'carat-left-small',
|
|
296
|
-
'carat-left',
|
|
297
|
-
'carat-right-small',
|
|
298
|
-
'carat-right',
|
|
299
|
-
'carat-up-small',
|
|
300
|
-
'carat-up',
|
|
301
|
-
],
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
name: 'Icon',
|
|
307
|
-
props: [
|
|
308
|
-
{
|
|
309
|
-
name: 'icon',
|
|
310
|
-
values: [
|
|
311
|
-
'carat-down-small',
|
|
312
|
-
'carat-down',
|
|
313
|
-
'carat-left-small',
|
|
314
|
-
'carat-left',
|
|
315
|
-
'carat-right-small',
|
|
316
|
-
'carat-right',
|
|
317
|
-
'carat-up-small',
|
|
318
|
-
'carat-up',
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
],
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
name: 'Box',
|
|
325
|
-
props: deprecatedBoxPropValues,
|
|
34
|
+
name: 'SectionHeading',
|
|
35
|
+
props: ['fontSize', 'fontWeight'],
|
|
326
36
|
},
|
|
327
37
|
],
|
|
328
38
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/eslint-plugin",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1-rc2.0",
|
|
4
4
|
"description": "Hero Design's eslint plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"eslint": "^8.10.0",
|
|
26
26
|
"eslint-plugin-eslint-plugin": "^5.0.0",
|
|
27
27
|
"eslint-plugin-node": "^11.1.0",
|
|
28
|
-
"jest": "^
|
|
29
|
-
"prettier-config-hd": "
|
|
28
|
+
"jest": "^29.2.1",
|
|
29
|
+
"prettier-config-hd": "8.42.5-rc2.0"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": "^14.17.0 || ^16.0.0 || >= 18.0.0"
|
package/.turbo/turbo-lint.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$ eslint .
|
|
File without changes
|