@plumeria/eslint-plugin 18.3.2 → 18.3.3
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.
|
@@ -96,6 +96,9 @@ const lengthValueProperties = [
|
|
|
96
96
|
'zoom',
|
|
97
97
|
];
|
|
98
98
|
const lengthPercentage = [
|
|
99
|
+
'animationRange',
|
|
100
|
+
'animationRangeEnd',
|
|
101
|
+
'animationRangeStart',
|
|
99
102
|
'width',
|
|
100
103
|
'maxWidth',
|
|
101
104
|
'minWidth',
|
|
@@ -181,6 +184,45 @@ const lengthPercentage = [
|
|
|
181
184
|
'transformOrigin',
|
|
182
185
|
'verticalAlign',
|
|
183
186
|
];
|
|
187
|
+
const insetProperties = [
|
|
188
|
+
'top',
|
|
189
|
+
'right',
|
|
190
|
+
'bottom',
|
|
191
|
+
'left',
|
|
192
|
+
'inset',
|
|
193
|
+
'insetBlock',
|
|
194
|
+
'insetBlockStart',
|
|
195
|
+
'insetBlockEnd',
|
|
196
|
+
'insetInline',
|
|
197
|
+
'insetInlineStart',
|
|
198
|
+
'insetInlineEnd',
|
|
199
|
+
];
|
|
200
|
+
const anchorSizeProperties = [
|
|
201
|
+
...insetProperties,
|
|
202
|
+
'margin',
|
|
203
|
+
'marginTop',
|
|
204
|
+
'marginRight',
|
|
205
|
+
'marginBottom',
|
|
206
|
+
'marginLeft',
|
|
207
|
+
'marginBlock',
|
|
208
|
+
'marginBlockStart',
|
|
209
|
+
'marginBlockEnd',
|
|
210
|
+
'marginInline',
|
|
211
|
+
'marginInlineStart',
|
|
212
|
+
'marginInlineEnd',
|
|
213
|
+
'width',
|
|
214
|
+
'minWidth',
|
|
215
|
+
'maxWidth',
|
|
216
|
+
'height',
|
|
217
|
+
'minHeight',
|
|
218
|
+
'maxHeight',
|
|
219
|
+
'blockSize',
|
|
220
|
+
'minBlockSize',
|
|
221
|
+
'maxBlockSize',
|
|
222
|
+
'inlineSize',
|
|
223
|
+
'minInlineSize',
|
|
224
|
+
'maxInlineSize',
|
|
225
|
+
];
|
|
184
226
|
const fitContentString = 'fit-content\\([^()]*\\)';
|
|
185
227
|
const minString = 'min\\([^()]*\\)';
|
|
186
228
|
const maxString = 'max\\([^()]*\\)';
|
|
@@ -722,6 +764,8 @@ function getLengthValuePattern(key) {
|
|
|
722
764
|
];
|
|
723
765
|
const isFitContent = isFitContentGroup.includes(key);
|
|
724
766
|
const isLengthPercentage = lengthPercentage.includes(key);
|
|
767
|
+
const isAnchor = insetProperties.includes(key);
|
|
768
|
+
const isAnchorSize = anchorSizeProperties.includes(key);
|
|
725
769
|
return (`${lengthPattern}` +
|
|
726
770
|
(isLengthPercentage ? `|${percentagePattern}` : '') +
|
|
727
771
|
(isFitContent ? `|${fitContentString}` : '') +
|
|
@@ -732,9 +776,20 @@ function getLengthValuePattern(key) {
|
|
|
732
776
|
(isBackgroundPositionX ? '|left|center|right' : '') +
|
|
733
777
|
(isBackgroundPosition ? '|top|bottom|center|left|right' : '') +
|
|
734
778
|
(isBackgroundSize ? '|cover|contain' : '') +
|
|
735
|
-
`|${
|
|
779
|
+
(isAnchor ? `|${anchorString}` : '') +
|
|
780
|
+
(isAnchorSize ? `|${anchorSizeString}` : '') +
|
|
781
|
+
`|${calcString}|${clampString}|${minString}|${maxString}|${varString}`);
|
|
736
782
|
}
|
|
737
783
|
const validatorCache = new Map();
|
|
784
|
+
const foldedValueCache = new Map();
|
|
785
|
+
function getFoldedValues(key) {
|
|
786
|
+
const cached = foldedValueCache.get(key);
|
|
787
|
+
if (cached)
|
|
788
|
+
return cached;
|
|
789
|
+
const folded = new Set(validData_1.validData[key].map((v) => v.toLowerCase()));
|
|
790
|
+
foldedValueCache.set(key, folded);
|
|
791
|
+
return folded;
|
|
792
|
+
}
|
|
738
793
|
function getValidator(key) {
|
|
739
794
|
if (validatorCache.has(key))
|
|
740
795
|
return validatorCache.get(key);
|
|
@@ -1170,6 +1225,7 @@ function getValidator(key) {
|
|
|
1170
1225
|
}
|
|
1171
1226
|
else if ([
|
|
1172
1227
|
'animationName',
|
|
1228
|
+
'animationTimeline',
|
|
1173
1229
|
'counterIncrement',
|
|
1174
1230
|
'counterReset',
|
|
1175
1231
|
'counterSet',
|
|
@@ -1571,6 +1627,21 @@ function getValidator(key) {
|
|
|
1571
1627
|
const r = new RegExp(`^(${dr})(,\\s*(${dr}))*$`);
|
|
1572
1628
|
validator = (v) => r.test(v);
|
|
1573
1629
|
}
|
|
1630
|
+
else if (['animationRange', 'animationRangeStart', 'animationRangeEnd'].includes(key)) {
|
|
1631
|
+
const rangeName = [
|
|
1632
|
+
'entry-crossing',
|
|
1633
|
+
'exit-crossing',
|
|
1634
|
+
'cover',
|
|
1635
|
+
'contain',
|
|
1636
|
+
'entry',
|
|
1637
|
+
'exit',
|
|
1638
|
+
'scroll',
|
|
1639
|
+
].join('|');
|
|
1640
|
+
const bound = `(?:normal|(?:${lvp})|(?:${rangeName})(?:\\s+(?:${lvp}))?)`;
|
|
1641
|
+
const segment = key === 'animationRange' ? `${bound}(?:\\s+${bound})?` : bound;
|
|
1642
|
+
const r = new RegExp(`^${segment}(?:\\s*,\\s*${segment})*$`);
|
|
1643
|
+
validator = (v) => r.test(v);
|
|
1644
|
+
}
|
|
1574
1645
|
else if ([
|
|
1575
1646
|
'animationDelay',
|
|
1576
1647
|
'animationDuration',
|
|
@@ -1739,13 +1810,15 @@ exports.validateValues = {
|
|
|
1739
1810
|
return;
|
|
1740
1811
|
const value = rawValue;
|
|
1741
1812
|
const normalized = normalizeCssVariables(value);
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1813
|
+
const folded = value.toLowerCase();
|
|
1814
|
+
const globalValue = !getFoldedValues(key).has(folded) &&
|
|
1815
|
+
!globalValues.includes(folded) &&
|
|
1744
1816
|
!normalized?.isStandalone;
|
|
1745
1817
|
if (!globalValue)
|
|
1746
1818
|
return;
|
|
1747
1819
|
const validator = getValidator(key);
|
|
1748
|
-
|
|
1820
|
+
const accepts = (v) => !!validator && (validator(v) || validator(v.toLowerCase()));
|
|
1821
|
+
if (validator && (!normalized || !accepts(normalized.value))) {
|
|
1749
1822
|
context.report({
|
|
1750
1823
|
node: property.value,
|
|
1751
1824
|
messageId: 'validateValue',
|
|
@@ -212,6 +212,7 @@ exports.propertyGroups = [
|
|
|
212
212
|
'overflowWrap',
|
|
213
213
|
'tabSize',
|
|
214
214
|
'whiteSpace',
|
|
215
|
+
'whiteSpaceCollapse',
|
|
215
216
|
],
|
|
216
217
|
},
|
|
217
218
|
{
|
|
@@ -352,6 +353,9 @@ exports.propertyGroups = [
|
|
|
352
353
|
'borderStyle',
|
|
353
354
|
'borderWidth',
|
|
354
355
|
'borderBlock',
|
|
356
|
+
'borderBlockColor',
|
|
357
|
+
'borderBlockStyle',
|
|
358
|
+
'borderBlockWidth',
|
|
355
359
|
'borderBlockStart',
|
|
356
360
|
'borderBlockStartColor',
|
|
357
361
|
'borderBlockStartStyle',
|
|
@@ -361,6 +365,9 @@ exports.propertyGroups = [
|
|
|
361
365
|
'borderBlockEndStyle',
|
|
362
366
|
'borderBlockEndWidth',
|
|
363
367
|
'borderInline',
|
|
368
|
+
'borderInlineColor',
|
|
369
|
+
'borderInlineStyle',
|
|
370
|
+
'borderInlineWidth',
|
|
364
371
|
'borderInlineStart',
|
|
365
372
|
'borderInlineStartColor',
|
|
366
373
|
'borderInlineStartStyle',
|
|
@@ -490,7 +497,13 @@ exports.propertyGroups = [
|
|
|
490
497
|
'animationDelay',
|
|
491
498
|
'animationIterationCount',
|
|
492
499
|
'animationDirection',
|
|
500
|
+
'animationFillMode',
|
|
493
501
|
'animationPlayState',
|
|
502
|
+
'animationComposition',
|
|
503
|
+
'animationTimeline',
|
|
504
|
+
'animationRange',
|
|
505
|
+
'animationRangeStart',
|
|
506
|
+
'animationRangeEnd',
|
|
494
507
|
],
|
|
495
508
|
},
|
|
496
509
|
{
|
package/dist/util/validData.js
CHANGED
|
@@ -10,6 +10,15 @@ const easingKeywords = [
|
|
|
10
10
|
'step-start',
|
|
11
11
|
'step-end',
|
|
12
12
|
];
|
|
13
|
+
const timelineRangeNames = [
|
|
14
|
+
'cover',
|
|
15
|
+
'contain',
|
|
16
|
+
'entry',
|
|
17
|
+
'exit',
|
|
18
|
+
'entry-crossing',
|
|
19
|
+
'exit-crossing',
|
|
20
|
+
'scroll',
|
|
21
|
+
];
|
|
13
22
|
const fontSizeSubValues = [
|
|
14
23
|
'xx-small',
|
|
15
24
|
'x-small',
|
|
@@ -159,6 +168,10 @@ const validData = {
|
|
|
159
168
|
animationIterationCount: [],
|
|
160
169
|
animationName: ['none', 'slide', 'bounce'],
|
|
161
170
|
animationPlayState: [],
|
|
171
|
+
animationRange: ['normal', ...timelineRangeNames],
|
|
172
|
+
animationRangeEnd: ['normal', ...timelineRangeNames],
|
|
173
|
+
animationRangeStart: ['normal', ...timelineRangeNames],
|
|
174
|
+
animationTimeline: ['none', 'auto'],
|
|
162
175
|
animationTimingFunction: [...easingKeywords],
|
|
163
176
|
aspectRatio: ['auto'],
|
|
164
177
|
backdropFilter: ['none'],
|