@plumeria/eslint-plugin 0.19.2 → 0.19.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.
@@ -0,0 +1,2 @@
1
+ declare const colorValue: string;
2
+ export { colorValue };
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.colorValue = void 0;
4
+ const colorNames = [
5
+ 'currentColor',
6
+ 'transparent',
7
+ 'aliceblue',
8
+ 'antiquewhite',
9
+ 'aqua',
10
+ 'aquamarine',
11
+ 'azure',
12
+ 'beige',
13
+ 'bisque',
14
+ 'black',
15
+ 'blanchedalmond',
16
+ 'blue',
17
+ 'blueviolet',
18
+ 'brown',
19
+ 'burlywood',
20
+ 'cadetblue',
21
+ 'chartreuse',
22
+ 'chocolate',
23
+ 'coral',
24
+ 'cornflowerblue',
25
+ 'cornsilk',
26
+ 'crimson',
27
+ 'cyan',
28
+ 'darkblue',
29
+ 'darkcyan',
30
+ 'darkgoldenrod',
31
+ 'darkgray',
32
+ 'darkgreen',
33
+ 'darkgrey',
34
+ 'darkkhaki',
35
+ 'darkmagenta',
36
+ 'darkolivegreen',
37
+ 'darkorange',
38
+ 'darkorchid',
39
+ 'darkred',
40
+ 'darksalmon',
41
+ 'darkseagreen',
42
+ 'darkslateblue',
43
+ 'darkslategray',
44
+ 'darkslategrey',
45
+ 'darkturquoise',
46
+ 'darkviolet',
47
+ 'deeppink',
48
+ 'deepskyblue',
49
+ 'dimgray',
50
+ 'dimgrey',
51
+ 'dodgerblue',
52
+ 'firebrick',
53
+ 'floralwhite',
54
+ 'forestgreen',
55
+ 'fuchsia',
56
+ 'gainsboro',
57
+ 'ghostwhite',
58
+ 'gold',
59
+ 'goldenrod',
60
+ 'gray',
61
+ 'green',
62
+ 'greenyellow',
63
+ 'grey',
64
+ 'honeydew',
65
+ 'hotpink',
66
+ 'indianred',
67
+ 'indigo',
68
+ 'ivory',
69
+ 'khaki',
70
+ 'lavender',
71
+ 'lavenderblush',
72
+ 'lawngreen',
73
+ 'lemonchiffon',
74
+ 'lightblue',
75
+ 'lightcoral',
76
+ 'lightcyan',
77
+ 'lightgoldenrodyellow',
78
+ 'lightgray',
79
+ 'lightgreen',
80
+ 'lightgrey',
81
+ 'lightpink',
82
+ 'lightsalmon',
83
+ 'lightseagreen',
84
+ 'lightskyblue',
85
+ 'lightslategray',
86
+ 'lightslategrey',
87
+ 'lightsteelblue',
88
+ 'lightyellow',
89
+ 'lime',
90
+ 'limegreen',
91
+ 'linen',
92
+ 'magenta',
93
+ 'maroon',
94
+ 'mediumaquamarine',
95
+ 'mediumblue',
96
+ 'mediumorchid',
97
+ 'mediumpurple',
98
+ 'mediumseagreen',
99
+ 'mediumslateblue',
100
+ 'mediumspringgreen',
101
+ 'mediumturquoise',
102
+ 'mediumvioletred',
103
+ 'midnightblue',
104
+ 'mintcream',
105
+ 'mistyrose',
106
+ 'moccasin',
107
+ 'navajowhite',
108
+ 'navy',
109
+ 'oldlace',
110
+ 'olive',
111
+ 'olivedrab',
112
+ 'orange',
113
+ 'orangered',
114
+ 'orchid',
115
+ 'palegoldenrod',
116
+ 'palegreen',
117
+ 'paleturquoise',
118
+ 'palevioletred',
119
+ 'papayawhip',
120
+ 'peachpuff',
121
+ 'peru',
122
+ 'pink',
123
+ 'plum',
124
+ 'powderblue',
125
+ 'purple',
126
+ 'rebeccapurple',
127
+ 'red',
128
+ 'rosybrown',
129
+ 'royalblue',
130
+ 'saddlebrown',
131
+ 'salmon',
132
+ 'sandybrown',
133
+ 'seagreen',
134
+ 'seashell',
135
+ 'sienna',
136
+ 'silver',
137
+ 'skyblue',
138
+ 'slateblue',
139
+ 'slategray',
140
+ 'slategrey',
141
+ 'snow',
142
+ 'springgreen',
143
+ 'steelblue',
144
+ 'tan',
145
+ 'teal',
146
+ 'thistle',
147
+ 'tomato',
148
+ 'turquoise',
149
+ 'violet',
150
+ 'wheat',
151
+ 'white',
152
+ 'whitesmoke',
153
+ 'yellow',
154
+ 'yellowgreen',
155
+ ].join('|');
156
+ const numberPattern = '-?\\d+(?:\\.\\d+)?%?';
157
+ const percentagePattern = `${numberPattern}%`;
158
+ const angleUnit = '(?:deg|grad|rad|turn)?';
159
+ const anglePattern = `${numberPattern}${angleUnit}`;
160
+ const alphaPattern = `(?:\\s/\\s${numberPattern}%?)?`;
161
+ const separator = '(?:\\s?,\\s?|\\s{1})';
162
+ const hexPattern = '#(?:[0-9a-fA-F]{3,8})';
163
+ const rgbFunctionName = 'rgb(?:a)?';
164
+ const rgbCommaParameters = `\\(\\s*${numberPattern}(?:\\s*,\\s*${numberPattern}){2}(?:\\s*,\\s*${numberPattern}%?)?\\s*\\)`;
165
+ const rgbSpaceParameters = `\\(\\s*${numberPattern}(?:\\s+${numberPattern}){2}${alphaPattern}\\s*\\)`;
166
+ const rgbPattern = `${rgbFunctionName}(?:${rgbCommaParameters}|${rgbSpaceParameters})`;
167
+ const hslFunctionName = 'hsl(?:a)?';
168
+ const hslCommaParameters = `\\(\\s*${anglePattern}(?:\\s*,\\s*${percentagePattern}){2}(?:\\s*,\\s*${numberPattern}%?)?\\s*\\)`;
169
+ const hslSpaceParameters = `\\(\\s*${anglePattern}(?:\\s+${percentagePattern}){2}${alphaPattern}\\s*\\)`;
170
+ const hslPattern = `${hslFunctionName}(?:${hslCommaParameters}|${hslSpaceParameters})`;
171
+ const hwbFunctionName = 'hwb';
172
+ const hwbCommaParameters = `\\(\\s*${anglePattern}(?:\\s*,\\s*${percentagePattern}){2}(?:\\s*,\\s*${numberPattern}%?)?\\s*\\)`;
173
+ const hwbSpaceParameters = `\\(\\s*${anglePattern}(?:\\s+${percentagePattern}){2}${alphaPattern}\\s*\\)`;
174
+ const hwbPattern = `${hwbFunctionName}(?:${hwbCommaParameters}|${hwbSpaceParameters})`;
175
+ const labFunctionName = '(?:lab|oklab)';
176
+ const labParameters = `\\(\\s*${percentagePattern}(?:\\s+${numberPattern}){2}${alphaPattern}\\s*\\)`;
177
+ const labPattern = `${labFunctionName}${labParameters}`;
178
+ const lchFunctionName = '(?:lch|oklch)';
179
+ const lchParameters = `\\(\\s*${percentagePattern}(?:\\s+${numberPattern}){2}${alphaPattern}\\s*\\)`;
180
+ const lchPattern = `${lchFunctionName}${lchParameters}`;
181
+ const colorFunctionName = 'color';
182
+ const colorSpaces = '(?:srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|rec2100-pq|rec2100-hlg|rec2100-linear|jzazbz|ictcp|xyz|xyz-d50|xyz-d65)';
183
+ const colorParameters = `\\(\\s*${colorSpaces}(?:${separator}${numberPattern}){3}${alphaPattern}\\s*\\)`;
184
+ const colorFunctionPattern = `${colorFunctionName}${colorParameters}`;
185
+ const colorValue = `(?:${hexPattern}|${rgbPattern}|${hslPattern}|${hwbPattern}|${labPattern}|${lchPattern}|${colorFunctionPattern}|${colorNames})`;
186
+ exports.colorValue = colorValue;
@@ -0,0 +1,5 @@
1
+ declare function isValidPlaceContent(value: string): boolean;
2
+ declare function isValidPlaceItems(value: string): boolean;
3
+ declare function isValidPlaceSelf(value: string): boolean;
4
+ declare function isValidTouchAction(value: string): boolean;
5
+ export { isValidPlaceContent, isValidPlaceItems, isValidPlaceSelf, isValidTouchAction, };
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidPlaceContent = isValidPlaceContent;
4
+ exports.isValidPlaceItems = isValidPlaceItems;
5
+ exports.isValidPlaceSelf = isValidPlaceSelf;
6
+ exports.isValidTouchAction = isValidTouchAction;
7
+ const dashedIdentString = '--[a-zA-Z_][a-zA-Z0-9_-]*';
8
+ const varString = `var\\(${dashedIdentString}(,\\s*[^\\)]+)?\\)`;
9
+ const varRegex = new RegExp(`^${varString}$`);
10
+ function getBaselinePositions() {
11
+ const prefixes = ['', 'first ', 'last ', varString + ' '];
12
+ return prefixes.map((prefix) => `${prefix}(baseline|${varString})`);
13
+ }
14
+ function getOverflowPositions() {
15
+ return ['unsafe', 'safe', varString];
16
+ }
17
+ function getContentDistributions() {
18
+ return [
19
+ 'space-between',
20
+ 'space-around',
21
+ 'space-evenly',
22
+ 'stretch',
23
+ varString,
24
+ ];
25
+ }
26
+ function getContentPositions() {
27
+ return ['center', 'start', 'end', 'flex-start', 'flex-end', varString];
28
+ }
29
+ function getAlignContent() {
30
+ const results = ['normal', varString];
31
+ results.push(...getBaselinePositions());
32
+ results.push(...getContentDistributions());
33
+ const contentPositions = getContentPositions();
34
+ const overflowPositions = getOverflowPositions();
35
+ results.push(...contentPositions);
36
+ overflowPositions.forEach((overflow) => {
37
+ contentPositions.forEach((pos) => {
38
+ results.push(`${overflow} ${pos}`);
39
+ });
40
+ });
41
+ return results;
42
+ }
43
+ function getJustifyContent() {
44
+ const results = ['normal', varString];
45
+ results.push(...getContentDistributions());
46
+ const contentPositions = getContentPositions();
47
+ const overflowPositions = getOverflowPositions();
48
+ results.push(...contentPositions);
49
+ const positions = contentPositions.concat(['left', 'right', varString]);
50
+ overflowPositions.forEach((overflow) => {
51
+ positions.forEach((pos) => {
52
+ results.push(`${overflow} ${pos}`);
53
+ });
54
+ });
55
+ return results;
56
+ }
57
+ function generatePlaceContentPattern() {
58
+ const alignContent = getAlignContent();
59
+ const justifyContent = getJustifyContent();
60
+ const pattern = [];
61
+ alignContent.forEach((align) => {
62
+ pattern.push(align);
63
+ });
64
+ alignContent.forEach((align) => {
65
+ justifyContent.forEach((justify) => {
66
+ pattern.push(`${align} ${justify}`);
67
+ });
68
+ });
69
+ return new RegExp(`^(${pattern.join('|')})$`);
70
+ }
71
+ function getPositions() {
72
+ return [
73
+ 'center',
74
+ 'start',
75
+ 'end',
76
+ 'self-start',
77
+ 'self-end',
78
+ 'flex-start',
79
+ 'flex-end',
80
+ varString,
81
+ ];
82
+ }
83
+ function getAlignItems() {
84
+ const results = ['normal', 'stretch', 'anchor-center', varString];
85
+ results.push(...getBaselinePositions());
86
+ const selfPositions = getPositions();
87
+ const overflowPositions = getOverflowPositions();
88
+ results.push(...selfPositions);
89
+ overflowPositions.forEach((overflow) => {
90
+ selfPositions.forEach((selfPos) => {
91
+ results.push(`${overflow} ${selfPos}`);
92
+ });
93
+ });
94
+ return results;
95
+ }
96
+ function getJustifyItems() {
97
+ const results = ['normal', 'stretch', 'anchor-center', 'legacy', varString];
98
+ results.push(...getBaselinePositions());
99
+ results.push('legacy left', 'legacy right', 'legacy center');
100
+ results.push('left', 'right');
101
+ const selfPositions = getPositions();
102
+ const overflowPositions = getOverflowPositions();
103
+ results.push(...selfPositions);
104
+ const positions = selfPositions.concat(['left', 'right', varString]);
105
+ overflowPositions.forEach((overflow) => {
106
+ positions.forEach((pos) => {
107
+ results.push(`${overflow} ${pos}`);
108
+ });
109
+ });
110
+ return results;
111
+ }
112
+ function generatePlaceItemsPattern() {
113
+ const alignItems = getAlignItems();
114
+ const justifyItems = getJustifyItems();
115
+ const pattern = [];
116
+ alignItems.forEach((align) => {
117
+ pattern.push(align);
118
+ });
119
+ alignItems.forEach((align) => {
120
+ justifyItems.forEach((justify) => {
121
+ pattern.push(`${align} ${justify}`);
122
+ });
123
+ });
124
+ return new RegExp(`^(${pattern.join('|')})$`);
125
+ }
126
+ function getAlignSelf() {
127
+ const results = ['auto', 'normal', 'stretch', 'anchor-center', varString];
128
+ results.push(...getBaselinePositions());
129
+ const selfPositions = getPositions();
130
+ const overflowPositions = getOverflowPositions();
131
+ results.push(...selfPositions);
132
+ overflowPositions.forEach((overflow) => {
133
+ selfPositions.forEach((selfPos) => {
134
+ results.push(`${overflow} ${selfPos}`);
135
+ });
136
+ });
137
+ return results;
138
+ }
139
+ function getJustifySelf() {
140
+ const results = ['auto', 'normal', 'stretch', 'anchor-center', varString];
141
+ results.push(...getBaselinePositions());
142
+ const selfPositions = getPositions();
143
+ const overflowPositions = getOverflowPositions();
144
+ results.push(...selfPositions);
145
+ const positions = selfPositions.concat(['left', 'right', varString]);
146
+ overflowPositions.forEach((overflow) => {
147
+ positions.forEach((pos) => {
148
+ results.push(`${overflow} ${pos}`);
149
+ });
150
+ });
151
+ return results;
152
+ }
153
+ function generatePlaceSelfPattern() {
154
+ const alignSelf = getAlignSelf();
155
+ const justifySelf = getJustifySelf();
156
+ const pattern = [];
157
+ alignSelf.forEach((align) => {
158
+ pattern.push(align);
159
+ });
160
+ alignSelf.forEach((align) => {
161
+ justifySelf.forEach((justify) => {
162
+ pattern.push(`${align} ${justify}`);
163
+ });
164
+ });
165
+ return new RegExp(`^(${pattern.join('|')})$`);
166
+ }
167
+ function isValidPlaceContent(value) {
168
+ const trimmedValue = value.trim();
169
+ if (trimmedValue !== value) {
170
+ return false;
171
+ }
172
+ if (varRegex.test(trimmedValue)) {
173
+ return true;
174
+ }
175
+ const pattern = generatePlaceContentPattern();
176
+ return pattern.test(trimmedValue);
177
+ }
178
+ function isValidPlaceItems(value) {
179
+ const trimmedValue = value.trim();
180
+ if (trimmedValue !== value) {
181
+ return false;
182
+ }
183
+ if (varRegex.test(trimmedValue)) {
184
+ return true;
185
+ }
186
+ const pattern = generatePlaceItemsPattern();
187
+ return pattern.test(trimmedValue);
188
+ }
189
+ function isValidPlaceSelf(value) {
190
+ const trimmedValue = value.trim();
191
+ if (trimmedValue !== value) {
192
+ return false;
193
+ }
194
+ if (varRegex.test(trimmedValue)) {
195
+ return true;
196
+ }
197
+ const pattern = generatePlaceSelfPattern();
198
+ return pattern.test(trimmedValue);
199
+ }
200
+ function isValidTouchAction(value) {
201
+ const basicValues = ['auto', 'none', 'manipulation'];
202
+ const panX = ['pan-x', 'pan-left', 'pan-right'];
203
+ const panY = ['pan-y', 'pan-up', 'pan-down'];
204
+ const pinchZoom = ['pinch-zoom'];
205
+ const allValues = [...basicValues, ...panX, ...panY, ...pinchZoom];
206
+ const usedValues = new Set();
207
+ const trimmedValue = value.trim();
208
+ if (value !== trimmedValue) {
209
+ return false;
210
+ }
211
+ const tokens = trimmedValue.split(/\s+/);
212
+ return tokens.every((token) => {
213
+ if (token.startsWith('var(') && varRegex.test(token)) {
214
+ return true;
215
+ }
216
+ if (allValues.includes(token)) {
217
+ if (basicValues.includes(token)) {
218
+ return tokens.length === 1;
219
+ }
220
+ if (panX.includes(token) && usedValues.has('pan-x')) {
221
+ return false;
222
+ }
223
+ if (panY.includes(token) && usedValues.has('pan-y')) {
224
+ return false;
225
+ }
226
+ return !usedValues.has(token) && usedValues.add(token);
227
+ }
228
+ return false;
229
+ });
230
+ }
@@ -0,0 +1,5 @@
1
+ interface Group {
2
+ properties: string[];
3
+ }
4
+ export declare const propertyGroups: Group[];
5
+ export {};