stylelint-taro-rn 4.0.1 → 4.0.2
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/LICENSE +8 -8
- package/dist/index.cjs.js +373 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +369 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +8 -13
- package/dist/index.js.map +1 -0
- package/dist/rules/css-property-no-unknown/index.d.ts +5 -0
- package/dist/rules/css-property-no-unknown/index.js +60 -58
- package/dist/rules/css-property-no-unknown/index.js.map +1 -0
- package/dist/rules/font-weight-no-ignored-values/index.d.ts +5 -0
- package/dist/rules/font-weight-no-ignored-values/index.js +33 -38
- package/dist/rules/font-weight-no-ignored-values/index.js.map +1 -0
- package/dist/rules/index.d.ts +11 -0
- package/dist/rules/index.js +12 -16
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/line-height-no-value-without-unit/index.d.ts +5 -0
- package/dist/rules/line-height-no-value-without-unit/index.js +33 -38
- package/dist/rules/line-height-no-value-without-unit/index.js.map +1 -0
- package/dist/rules/style-property-no-unknown/index.d.ts +5 -0
- package/dist/rules/style-property-no-unknown/index.js +56 -55
- package/dist/rules/style-property-no-unknown/index.js.map +1 -0
- package/dist/utils/endsWith.d.ts +1 -0
- package/dist/utils/endsWith.js +3 -7
- package/dist/utils/endsWith.js.map +1 -0
- package/dist/utils/hasInterpolation.d.ts +7 -0
- package/dist/utils/hasInterpolation.js +15 -11
- package/dist/utils/hasInterpolation.js.map +1 -0
- package/{src/utils/hasLessInterpolation.js → dist/utils/hasLessInterpolation.d.ts} +1 -7
- package/dist/utils/hasLessInterpolation.js +9 -8
- package/dist/utils/hasLessInterpolation.js.map +1 -0
- package/dist/utils/hasPsvInterpolation.d.ts +4 -0
- package/dist/utils/hasPsvInterpolation.js +9 -8
- package/dist/utils/hasPsvInterpolation.js.map +1 -0
- package/dist/utils/hasScssInterpolation.d.ts +4 -0
- package/dist/utils/hasScssInterpolation.js +9 -8
- package/dist/utils/hasScssInterpolation.js.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/isCustomProperty.d.ts +4 -0
- package/dist/utils/isCustomProperty.js +6 -9
- package/dist/utils/isCustomProperty.js.map +1 -0
- package/dist/utils/isExportBlock.d.ts +4 -0
- package/dist/utils/isExportBlock.js +9 -12
- package/dist/utils/isExportBlock.js.map +1 -0
- package/dist/utils/isStandardSyntaxDeclaration.d.ts +4 -0
- package/dist/utils/isStandardSyntaxDeclaration.js +25 -31
- package/dist/utils/isStandardSyntaxDeclaration.js.map +1 -0
- package/dist/utils/isStandardSyntaxProperty.d.ts +4 -0
- package/dist/utils/isStandardSyntaxProperty.js +23 -29
- package/dist/utils/isStandardSyntaxProperty.js.map +1 -0
- package/dist/utils/isString.d.ts +1 -0
- package/dist/utils/isString.js +3 -7
- package/dist/utils/isString.js.map +1 -0
- package/dist/utils/kebabCase.d.ts +1 -0
- package/dist/utils/kebabCase.js +3 -7
- package/dist/utils/kebabCase.js.map +1 -0
- package/dist/utils/matchesStringOrRegExp.d.ts +12 -0
- package/dist/utils/matchesStringOrRegExp.js +45 -54
- package/dist/utils/matchesStringOrRegExp.js.map +1 -0
- package/dist/utils/namespace.d.ts +1 -0
- package/dist/utils/namespace.js +5 -8
- package/dist/utils/namespace.js.map +1 -0
- package/dist/utils/optionsMatches.d.ts +5 -0
- package/dist/utils/optionsMatches.js +10 -9
- package/dist/utils/optionsMatches.js.map +1 -0
- package/package.json +27 -46
- package/dist/utils/index.js +0 -68
- package/src/index.js +0 -10
- package/src/rules/css-property-no-unknown/README.md +0 -95
- package/src/rules/css-property-no-unknown/index.js +0 -79
- package/src/rules/font-weight-no-ignored-values/README.md +0 -61
- package/src/rules/font-weight-no-ignored-values/index.js +0 -42
- package/src/rules/index.js +0 -11
- package/src/rules/line-height-no-value-without-unit/README.md +0 -40
- package/src/rules/line-height-no-value-without-unit/index.js +0 -44
- package/src/rules/style-property-no-unknown/README.md +0 -95
- package/src/rules/style-property-no-unknown/index.js +0 -74
- package/src/utils/endsWith.js +0 -2
- package/src/utils/hasInterpolation.js +0 -21
- package/src/utils/hasPsvInterpolation.js +0 -10
- package/src/utils/hasScssInterpolation.js +0 -10
- package/src/utils/index.js +0 -9
- package/src/utils/isCustomProperty.js +0 -6
- package/src/utils/isExportBlock.js +0 -10
- package/src/utils/isStandardSyntaxDeclaration.js +0 -34
- package/src/utils/isStandardSyntaxProperty.js +0 -32
- package/src/utils/isString.js +0 -1
- package/src/utils/kebabCase.js +0 -2
- package/src/utils/matchesStringOrRegExp.js +0 -72
- package/src/utils/namespace.js +0 -5
- package/src/utils/optionsMatches.js +0 -18
package/LICENSE
CHANGED
|
@@ -154,15 +154,8 @@ See `/LICENSE` for details of the license.
|
|
|
154
154
|
|
|
155
155
|
==================
|
|
156
156
|
|
|
157
|
-
MIT (stencil-vue2-output-target):
|
|
158
|
-
The following files embed [stencil-vue2-output-target](https://github.com/diondree/stencil-vue2-output-target) MIT:
|
|
159
|
-
`/packages/taro-components-library-vue2/src/vue-component-lib/utils.ts`
|
|
160
|
-
See `/LICENSE` for details of the license.
|
|
161
|
-
|
|
162
|
-
==================
|
|
163
|
-
|
|
164
157
|
MIT (weui):
|
|
165
|
-
The following files embed [
|
|
158
|
+
The following files embed [weui](https://github.com/Tencent/weui) MIT:
|
|
166
159
|
`/packages/taro-components/src/components/*.scss`
|
|
167
160
|
See `/LICENSE.txt` for details of the license.
|
|
168
161
|
|
|
@@ -172,3 +165,10 @@ Apache-2.0 (intersection-observer):
|
|
|
172
165
|
The following files embed [intersection-observer](https://github.com/GoogleChromeLabs/intersection-observer) Apache-2.0:
|
|
173
166
|
`/packages/taro-api/src/polyfill/intersection-observer.ts`
|
|
174
167
|
See `/LICENSE.txt` for details of the license.
|
|
168
|
+
|
|
169
|
+
==================
|
|
170
|
+
|
|
171
|
+
MIT (babel-plugin-jsx-dom-expressions):
|
|
172
|
+
The following files embed [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/blob/main/packages/babel-plugin-jsx-dom-expressions) MIT:
|
|
173
|
+
`/packages/babel-plugin-transform-solid-jsx/src/*`
|
|
174
|
+
See `/LICENSE` for details of the license.
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var stylelint = require('stylelint');
|
|
6
|
+
var reactNativeKnownStylingProperties = require('react-native-known-styling-properties');
|
|
7
|
+
var declarationValueIndex = require('stylelint/lib/utils/declarationValueIndex.cjs');
|
|
8
|
+
|
|
9
|
+
const endsWith = (str, suffix) => str.indexOf(suffix, str.length - suffix.length) !== -1;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Check whether a string has less interpolation
|
|
13
|
+
*
|
|
14
|
+
* @param {string} string
|
|
15
|
+
* @return {boolean} If `true`, a string has less interpolation
|
|
16
|
+
*/
|
|
17
|
+
function hasLessInterpolation(string /*: string */) {
|
|
18
|
+
if (/@{.+?}/.test(string)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Check whether a string has postcss-simple-vars interpolation
|
|
26
|
+
*/
|
|
27
|
+
function hasPsvInterpolation(string /*: string */) {
|
|
28
|
+
if (/\$\(.+?\)/.test(string)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a string has scss interpolation
|
|
36
|
+
*/
|
|
37
|
+
function hasScssInterpolation(string /*: string */) {
|
|
38
|
+
if (/#{.+?}/.test(string)) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check whether a string has interpolation
|
|
46
|
+
*
|
|
47
|
+
* @param {string} string
|
|
48
|
+
* @return {boolean} If `true`, a string has interpolation
|
|
49
|
+
*/
|
|
50
|
+
function hasInterpolation(string /*: string */) {
|
|
51
|
+
// SCSS or Less interpolation
|
|
52
|
+
if (hasLessInterpolation(string) ||
|
|
53
|
+
hasScssInterpolation(string) ||
|
|
54
|
+
hasPsvInterpolation(string)) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check whether a property is a custom one
|
|
62
|
+
*/
|
|
63
|
+
function isCustomProperty(property /*: string */) {
|
|
64
|
+
return property.slice(0, 2) === '--';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Check whether a node is an :export block
|
|
69
|
+
*/
|
|
70
|
+
function isExportBlock(node /*: Object */) {
|
|
71
|
+
if (node.type === 'rule' && node.selector && node.selector === ':export') {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check whether a declaration is standard
|
|
79
|
+
*/
|
|
80
|
+
function isStandardSyntaxDeclaration(decl /*: Object */) {
|
|
81
|
+
const prop = decl.prop;
|
|
82
|
+
const parent = decl.parent;
|
|
83
|
+
// Declarations belong in a declaration block
|
|
84
|
+
if (parent.type === 'root') {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
// Sass var (e.g. $var: x), nested list (e.g. $list: (x)) or nested map (e.g. $map: (key:value))
|
|
88
|
+
if (prop[0] === '$') {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
// Less var (e.g. @var: x), but exclude variable interpolation (e.g. @{var})
|
|
92
|
+
if (prop[0] === '@' && prop[1] !== '{') {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
// Sass nested properties (e.g. border: { style: solid; color: red; })
|
|
96
|
+
if (parent.selector &&
|
|
97
|
+
parent.selector[parent.selector.length - 1] === ':' &&
|
|
98
|
+
parent.selector.substring(0, 2) !== '--') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Check whether a property is standard
|
|
106
|
+
*/
|
|
107
|
+
function isStandardSyntaxProperty(property /*: string */) {
|
|
108
|
+
// SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))
|
|
109
|
+
if (property[0] === '$') {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// Less var (e.g. @var: x)
|
|
113
|
+
if (property[0] === '@') {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
// Less append property value with space (e.g. transform+_: scale(2))
|
|
117
|
+
if (endsWith(property, '+') || endsWith(property, '+_')) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
// SCSS or Less interpolation
|
|
121
|
+
if (hasInterpolation(property)) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const isString = string => typeof string === 'string';
|
|
128
|
+
|
|
129
|
+
const kebabCase = string => string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
130
|
+
|
|
131
|
+
const prefix = 'taro-rn';
|
|
132
|
+
function namespace(ruleName) {
|
|
133
|
+
return `${prefix}/${ruleName}`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Compares a string to a second value that, if it fits a certain convention,
|
|
138
|
+
* is converted to a regular expression before the comparison.
|
|
139
|
+
* If it doesn't fit the convention, then two strings are compared.
|
|
140
|
+
*
|
|
141
|
+
* Any strings starting and ending with `/` are interpreted
|
|
142
|
+
* as regular expressions.
|
|
143
|
+
*/
|
|
144
|
+
function matchesStringOrRegExp(input /*: string | Array<string> */, comparison /*: string | Array<string> */) {
|
|
145
|
+
if (!Array.isArray(input)) {
|
|
146
|
+
return testAgainstStringOrRegExpOrArray(input, comparison);
|
|
147
|
+
}
|
|
148
|
+
for (const inputItem of input) {
|
|
149
|
+
const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison);
|
|
150
|
+
if (testResult) {
|
|
151
|
+
return testResult;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
function testAgainstStringOrRegExpOrArray(value, comparison) {
|
|
157
|
+
if (!Array.isArray(comparison)) {
|
|
158
|
+
return testAgainstStringOrRegExp(value, comparison);
|
|
159
|
+
}
|
|
160
|
+
for (const comparisonItem of comparison) {
|
|
161
|
+
const testResult = testAgainstStringOrRegExp(value, comparisonItem);
|
|
162
|
+
if (testResult) {
|
|
163
|
+
return testResult;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
function testAgainstStringOrRegExp(value, comparison) {
|
|
169
|
+
// If it's a RegExp, test directly
|
|
170
|
+
if (comparison instanceof RegExp) {
|
|
171
|
+
return comparison.test(value)
|
|
172
|
+
? { match: value, pattern: comparison }
|
|
173
|
+
: false;
|
|
174
|
+
}
|
|
175
|
+
// Check if it's RegExp in a string
|
|
176
|
+
const firstComparisonChar = comparison[0];
|
|
177
|
+
const lastComparisonChar = comparison[comparison.length - 1];
|
|
178
|
+
const secondToLastComparisonChar = comparison[comparison.length - 2];
|
|
179
|
+
const comparisonIsRegex = firstComparisonChar === '/' &&
|
|
180
|
+
(lastComparisonChar === '/' ||
|
|
181
|
+
(secondToLastComparisonChar === '/' && lastComparisonChar === 'i'));
|
|
182
|
+
const hasCaseInsensitiveFlag = comparisonIsRegex && lastComparisonChar === 'i';
|
|
183
|
+
// If so, create a new RegExp from it
|
|
184
|
+
if (comparisonIsRegex) {
|
|
185
|
+
const valueMatches = hasCaseInsensitiveFlag
|
|
186
|
+
? new RegExp(comparison.slice(1, -2), 'i').test(value)
|
|
187
|
+
: new RegExp(comparison.slice(1, -1)).test(value);
|
|
188
|
+
return valueMatches ? { match: value, pattern: comparison } : false;
|
|
189
|
+
}
|
|
190
|
+
// Otherwise, it's a string. Do a strict comparison
|
|
191
|
+
return value === comparison ? { match: value, pattern: comparison } : false;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Check if an options object's propertyName contains a user-defined string or
|
|
196
|
+
* regex that matches the passed in input.
|
|
197
|
+
*/
|
|
198
|
+
function optionsMatches(options /*: Object */, propertyName /*: string */, input /*: string */) {
|
|
199
|
+
return !!(options &&
|
|
200
|
+
options[propertyName] &&
|
|
201
|
+
typeof input === 'string' &&
|
|
202
|
+
matchesStringOrRegExp(input, options[propertyName]));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const ruleName$3 = namespace('css-property-no-unknown');
|
|
206
|
+
const messages$3 = stylelint.utils.ruleMessages(ruleName$3, {
|
|
207
|
+
rejected: (property) => `无效的 React Native 样式属性 "${property}"`
|
|
208
|
+
});
|
|
209
|
+
const props$1 = reactNativeKnownStylingProperties.allCSS2RNProps.map(kebabCase);
|
|
210
|
+
function cssPropertyNoUnknown (actual, options) {
|
|
211
|
+
return function (root, result) {
|
|
212
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName$3, {
|
|
213
|
+
actual
|
|
214
|
+
}, {
|
|
215
|
+
actual: options,
|
|
216
|
+
possible: {
|
|
217
|
+
ignoreProperties: [isString]
|
|
218
|
+
},
|
|
219
|
+
optional: true
|
|
220
|
+
});
|
|
221
|
+
if (!validOptions) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
root.walkDecls((decl) => {
|
|
225
|
+
const prop = decl.prop;
|
|
226
|
+
if (!isStandardSyntaxProperty(prop)) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (!isStandardSyntaxDeclaration(decl)) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (isCustomProperty(prop)) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (isExportBlock(decl.parent)) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (optionsMatches(options, 'ignoreProperties', prop)) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (props$1.indexOf(prop.toLowerCase()) !== -1) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
stylelint.utils.report({
|
|
245
|
+
message: messages$3.rejected(prop),
|
|
246
|
+
node: decl,
|
|
247
|
+
result,
|
|
248
|
+
ruleName: ruleName$3
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const ruleName$2 = namespace('font-weight-no-ignored-values');
|
|
255
|
+
const messages$2 = stylelint.utils.ruleMessages(ruleName$2, {
|
|
256
|
+
rejected: (weight) => `Unexpected font-weight "${weight}"`
|
|
257
|
+
});
|
|
258
|
+
const acceptedWeights = ['400', '700', 'normal', 'bold'];
|
|
259
|
+
function fontWeightNoIgnoredValues (actual) {
|
|
260
|
+
return function (root, result) {
|
|
261
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName$2, {
|
|
262
|
+
actual
|
|
263
|
+
});
|
|
264
|
+
if (!validOptions) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
root.walkDecls(/^font-weight$/i, (decl) => {
|
|
268
|
+
if (acceptedWeights.indexOf(decl.value) > -1) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const weightValueOffset = decl.value.indexOf(decl.value);
|
|
272
|
+
const index = declarationValueIndex(decl) + weightValueOffset;
|
|
273
|
+
stylelint.utils.report({
|
|
274
|
+
message: messages$2.rejected(decl.value),
|
|
275
|
+
node: decl,
|
|
276
|
+
result,
|
|
277
|
+
ruleName: ruleName$2,
|
|
278
|
+
index
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const ruleName$1 = namespace('line-height-no-value-without-unit');
|
|
285
|
+
const messages$1 = stylelint.utils.ruleMessages(ruleName$1, {
|
|
286
|
+
rejected: (height) => `Unexpected line-height "${height}", expect a value with units`
|
|
287
|
+
});
|
|
288
|
+
const lengthRe = /^(0$|(?:[+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)(?=px|PX|rem$))/;
|
|
289
|
+
const viewportUnitRe = /^([+-]?[0-9.]+)(vh|vw|vmin|vmax)$/;
|
|
290
|
+
function lineHeightNoValueWithoutUnit (actual) {
|
|
291
|
+
return function (root, result) {
|
|
292
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName$1, {
|
|
293
|
+
actual
|
|
294
|
+
});
|
|
295
|
+
if (!validOptions) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
root.walkDecls(/^line-height$/i, (decl) => {
|
|
299
|
+
if (lengthRe.test(decl.value) || viewportUnitRe.test(decl.value)) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const valueOffset = decl.value.indexOf(decl.value);
|
|
303
|
+
const index = declarationValueIndex(decl) + valueOffset;
|
|
304
|
+
stylelint.utils.report({
|
|
305
|
+
message: messages$1.rejected(decl.value),
|
|
306
|
+
node: decl,
|
|
307
|
+
result,
|
|
308
|
+
ruleName: ruleName$1,
|
|
309
|
+
index
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const ruleName = namespace('style-property-no-unknown');
|
|
316
|
+
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
317
|
+
rejected: (property) => `无效的 React Native 样式属性 "${property}"`
|
|
318
|
+
});
|
|
319
|
+
const props = reactNativeKnownStylingProperties.allProps.map(kebabCase);
|
|
320
|
+
function stylePropertyNoUnknown (actual, options) {
|
|
321
|
+
return function (root, result) {
|
|
322
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName, {
|
|
323
|
+
actual
|
|
324
|
+
}, {
|
|
325
|
+
actual: options,
|
|
326
|
+
possible: {
|
|
327
|
+
ignoreProperties: [isString]
|
|
328
|
+
},
|
|
329
|
+
optional: true
|
|
330
|
+
});
|
|
331
|
+
if (!validOptions) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
root.walkDecls((decl) => {
|
|
335
|
+
const prop = decl.prop;
|
|
336
|
+
if (!isStandardSyntaxProperty(prop)) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (!isStandardSyntaxDeclaration(decl)) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (isCustomProperty(prop)) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
if (optionsMatches(options, 'ignoreProperties', prop)) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (props.indexOf(prop.toLowerCase()) !== -1) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
stylelint.utils.report({
|
|
352
|
+
message: messages.rejected(prop),
|
|
353
|
+
node: decl,
|
|
354
|
+
result,
|
|
355
|
+
ruleName
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
var rules = {
|
|
362
|
+
'font-weight-no-ignored-values': fontWeightNoIgnoredValues,
|
|
363
|
+
'css-property-no-unknown': cssPropertyNoUnknown,
|
|
364
|
+
'style-property-no-unknown': stylePropertyNoUnknown,
|
|
365
|
+
'line-height-no-value-without-unit': lineHeightNoValueWithoutUnit
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const rulesPlugins = Object.keys(rules).map((ruleName) => {
|
|
369
|
+
return stylelint.createPlugin(namespace(ruleName), rules[ruleName]);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
exports.default = rulesPlugins;
|
|
373
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/utils/endsWith.js","../src/utils/hasLessInterpolation.js","../src/utils/hasPsvInterpolation.js","../src/utils/hasScssInterpolation.js","../src/utils/hasInterpolation.js","../src/utils/isCustomProperty.js","../src/utils/isExportBlock.js","../src/utils/isStandardSyntaxDeclaration.js","../src/utils/isStandardSyntaxProperty.js","../src/utils/isString.js","../src/utils/kebabCase.js","../src/utils/namespace.js","../src/utils/matchesStringOrRegExp.js","../src/utils/optionsMatches.js","../src/rules/css-property-no-unknown/index.js","../src/rules/font-weight-no-ignored-values/index.js","../src/rules/line-height-no-value-without-unit/index.js","../src/rules/style-property-no-unknown/index.js","../src/rules/index.js","../src/index.js"],"sourcesContent":["export const endsWith = (str, suffix) =>\n str.indexOf(suffix, str.length - suffix.length) !== -1\n","/**\n * Check whether a string has less interpolation\n *\n * @param {string} string\n * @return {boolean} If `true`, a string has less interpolation\n */\nexport function hasLessInterpolation (string /*: string */) /*: boolean */ {\n if (/@{.+?}/.test(string)) {\n return true\n }\n\n return false\n}\n","/**\n * Check whether a string has postcss-simple-vars interpolation\n */\nexport function hasPsvInterpolation (string /*: string */) /*: boolean */ {\n if (/\\$\\(.+?\\)/.test(string)) {\n return true\n }\n\n return false\n}\n","/**\n * Check whether a string has scss interpolation\n */\nexport function hasScssInterpolation (string /*: string */) /*: boolean */ {\n if (/#{.+?}/.test(string)) {\n return true\n }\n\n return false\n}\n","import { hasLessInterpolation } from './hasLessInterpolation.js'\nimport { hasPsvInterpolation } from './hasPsvInterpolation.js'\nimport { hasScssInterpolation } from './hasScssInterpolation.js'\n\n/**\n * Check whether a string has interpolation\n *\n * @param {string} string\n * @return {boolean} If `true`, a string has interpolation\n */\nexport function hasInterpolation (string /*: string */) /*: boolean */ {\n // SCSS or Less interpolation\n if (\n hasLessInterpolation(string) ||\n hasScssInterpolation(string) ||\n hasPsvInterpolation(string)\n ) {\n return true\n }\n\n return false\n}\n","/**\n * Check whether a property is a custom one\n */\nexport function isCustomProperty (property /*: string */) /*: boolean */ {\n return property.slice(0, 2) === '--'\n}\n","/**\n * Check whether a node is an :export block\n */\nexport function isExportBlock (node /*: Object */) /*: boolean */ {\n if (node.type === 'rule' && node.selector && node.selector === ':export') {\n return true\n }\n\n return false\n}\n","/**\n * Check whether a declaration is standard\n */\nexport function isStandardSyntaxDeclaration (decl /*: Object */) /*: boolean */ {\n const prop = decl.prop\n const parent = decl.parent\n\n // Declarations belong in a declaration block\n\n if (parent.type === 'root') {\n return false\n }\n\n // Sass var (e.g. $var: x), nested list (e.g. $list: (x)) or nested map (e.g. $map: (key:value))\n if (prop[0] === '$') {\n return false\n }\n\n // Less var (e.g. @var: x), but exclude variable interpolation (e.g. @{var})\n if (prop[0] === '@' && prop[1] !== '{') {\n return false\n }\n\n // Sass nested properties (e.g. border: { style: solid; color: red; })\n if (\n parent.selector &&\n parent.selector[parent.selector.length - 1] === ':' &&\n parent.selector.substring(0, 2) !== '--'\n ) {\n return false\n }\n\n return true\n}\n","import { endsWith } from './endsWith.js'\nimport { hasInterpolation } from './hasInterpolation.js'\n\n/**\n * Check whether a property is standard\n */\nexport function isStandardSyntaxProperty (\n property /*: string */\n) /*: boolean */ {\n // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))\n if (property[0] === '$') {\n return false\n }\n\n // Less var (e.g. @var: x)\n if (property[0] === '@') {\n return false\n }\n\n // Less append property value with space (e.g. transform+_: scale(2))\n if (endsWith(property, '+') || endsWith(property, '+_')) {\n return false\n }\n\n // SCSS or Less interpolation\n if (hasInterpolation(property)) {\n return false\n }\n\n return true\n}\n","export const isString = string => typeof string === 'string'\n","export const kebabCase = string =>\n string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n","const prefix = 'taro-rn'\n\nexport function namespace (ruleName) {\n return `${prefix}/${ruleName}`\n}\n","/**\n * Compares a string to a second value that, if it fits a certain convention,\n * is converted to a regular expression before the comparison.\n * If it doesn't fit the convention, then two strings are compared.\n *\n * Any strings starting and ending with `/` are interpreted\n * as regular expressions.\n */\nexport function matchesStringOrRegExp (\n input /*: string | Array<string> */,\n comparison /*: string | Array<string> */\n) /*: false | { match: string, pattern: string } */ {\n if (!Array.isArray(input)) {\n return testAgainstStringOrRegExpOrArray(input, comparison)\n }\n\n for (const inputItem of input) {\n const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison)\n if (testResult) {\n return testResult\n }\n }\n\n return false\n}\n\nfunction testAgainstStringOrRegExpOrArray (value, comparison) {\n if (!Array.isArray(comparison)) {\n return testAgainstStringOrRegExp(value, comparison)\n }\n\n for (const comparisonItem of comparison) {\n const testResult = testAgainstStringOrRegExp(value, comparisonItem)\n if (testResult) {\n return testResult\n }\n }\n return false\n}\n\nfunction testAgainstStringOrRegExp (value, comparison) {\n // If it's a RegExp, test directly\n if (comparison instanceof RegExp) {\n return comparison.test(value)\n ? { match: value, pattern: comparison }\n : false\n }\n\n // Check if it's RegExp in a string\n const firstComparisonChar = comparison[0]\n const lastComparisonChar = comparison[comparison.length - 1]\n const secondToLastComparisonChar = comparison[comparison.length - 2]\n\n const comparisonIsRegex =\n firstComparisonChar === '/' &&\n (lastComparisonChar === '/' ||\n (secondToLastComparisonChar === '/' && lastComparisonChar === 'i'))\n\n const hasCaseInsensitiveFlag =\n comparisonIsRegex && lastComparisonChar === 'i'\n\n // If so, create a new RegExp from it\n if (comparisonIsRegex) {\n const valueMatches = hasCaseInsensitiveFlag\n ? new RegExp(comparison.slice(1, -2), 'i').test(value)\n : new RegExp(comparison.slice(1, -1)).test(value)\n return valueMatches ? { match: value, pattern: comparison } : false\n }\n\n // Otherwise, it's a string. Do a strict comparison\n return value === comparison ? { match: value, pattern: comparison } : false\n}\n","import { matchesStringOrRegExp } from './matchesStringOrRegExp.js'\n\n/**\n * Check if an options object's propertyName contains a user-defined string or\n * regex that matches the passed in input.\n */\nexport function optionsMatches (\n options /*: Object */,\n propertyName /*: string */,\n input /*: string */\n) /*: boolean */ {\n return !!(\n options &&\n options[propertyName] &&\n typeof input === 'string' &&\n matchesStringOrRegExp(input, options[propertyName])\n )\n}\n","import { allCSS2RNProps } from 'react-native-known-styling-properties'\nimport stylelint from 'stylelint'\n\nimport {\n isCustomProperty,\n isExportBlock,\n isStandardSyntaxDeclaration,\n isStandardSyntaxProperty,\n isString,\n kebabCase,\n namespace,\n optionsMatches\n} from '../../utils/index.js'\n\nexport const ruleName = namespace('css-property-no-unknown')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (property) => `无效的 React Native 样式属性 \"${property}\"`\n})\n\nconst props = allCSS2RNProps.map(kebabCase)\n\nexport default function (actual, options) {\n return function (root, result) {\n const validOptions = stylelint.utils.validateOptions(\n result,\n ruleName,\n {\n actual\n },\n {\n actual: options,\n possible: {\n ignoreProperties: [isString]\n },\n optional: true\n }\n )\n\n if (!validOptions) {\n return\n }\n\n root.walkDecls((decl) => {\n const prop = decl.prop\n\n if (!isStandardSyntaxProperty(prop)) {\n return\n }\n\n if (!isStandardSyntaxDeclaration(decl)) {\n return\n }\n\n if (isCustomProperty(prop)) {\n return\n }\n\n if (isExportBlock(decl.parent)) {\n return\n }\n\n if (optionsMatches(options, 'ignoreProperties', prop)) {\n return\n }\n\n if (props.indexOf(prop.toLowerCase()) !== -1) {\n return\n }\n\n stylelint.utils.report({\n message: messages.rejected(prop),\n node: decl,\n result,\n ruleName\n })\n })\n }\n}\n","import stylelint from 'stylelint'\nimport declarationValueIndex from 'stylelint/lib/utils/declarationValueIndex.cjs'\n\nimport { namespace } from '../../utils/index.js'\n\nexport const ruleName = namespace('font-weight-no-ignored-values')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (weight) => `Unexpected font-weight \"${weight}\"`\n})\n\nconst acceptedWeights = ['400', '700', 'normal', 'bold']\n\nexport default function (actual) {\n return function (root, result) {\n const validOptions = stylelint.utils.validateOptions(result, ruleName, {\n actual\n })\n\n if (!validOptions) {\n return\n }\n\n root.walkDecls(/^font-weight$/i, (decl) => {\n if (acceptedWeights.indexOf(decl.value) > -1) {\n return\n }\n\n const weightValueOffset = decl.value.indexOf(decl.value)\n const index = declarationValueIndex(decl) + weightValueOffset\n\n stylelint.utils.report({\n message: messages.rejected(decl.value),\n node: decl,\n result,\n ruleName,\n index\n })\n })\n }\n}\n","import stylelint from 'stylelint'\nimport declarationValueIndex from 'stylelint/lib/utils/declarationValueIndex.cjs'\n\nimport { namespace } from '../../utils/index.js'\n\nexport const ruleName = namespace('line-height-no-value-without-unit')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (height) =>\n `Unexpected line-height \"${height}\", expect a value with units`\n})\n\nconst lengthRe = /^(0$|(?:[+-]?(?:\\d*\\.)?\\d+(?:[Ee][+-]?\\d+)?)(?=px|PX|rem$))/\nconst viewportUnitRe = /^([+-]?[0-9.]+)(vh|vw|vmin|vmax)$/\n\nexport default function (actual) {\n return function (root, result) {\n const validOptions = stylelint.utils.validateOptions(result, ruleName, {\n actual\n })\n\n if (!validOptions) {\n return\n }\n\n root.walkDecls(/^line-height$/i, (decl) => {\n if (lengthRe.test(decl.value) || viewportUnitRe.test(decl.value)) {\n return\n }\n\n const valueOffset = decl.value.indexOf(decl.value)\n const index = declarationValueIndex(decl) + valueOffset\n\n stylelint.utils.report({\n message: messages.rejected(decl.value),\n node: decl,\n result,\n ruleName,\n index\n })\n })\n }\n}\n","import { allProps } from 'react-native-known-styling-properties'\nimport stylelint from 'stylelint'\n\nimport {\n isCustomProperty,\n isStandardSyntaxDeclaration,\n isStandardSyntaxProperty,\n isString,\n kebabCase,\n namespace,\n optionsMatches\n} from '../../utils/index.js'\n\nexport const ruleName = namespace('style-property-no-unknown')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (property) => `无效的 React Native 样式属性 \"${property}\"`\n})\n\nconst props = allProps.map(kebabCase)\n\nexport default function (actual, options) {\n return function (root, result) {\n const validOptions = stylelint.utils.validateOptions(\n result,\n ruleName,\n {\n actual\n },\n {\n actual: options,\n possible: {\n ignoreProperties: [isString]\n },\n optional: true\n }\n )\n\n if (!validOptions) {\n return\n }\n\n root.walkDecls((decl) => {\n const prop = decl.prop\n\n if (!isStandardSyntaxProperty(prop)) {\n return\n }\n\n if (!isStandardSyntaxDeclaration(decl)) {\n return\n }\n\n if (isCustomProperty(prop)) {\n return\n }\n\n if (optionsMatches(options, 'ignoreProperties', prop)) {\n return\n }\n\n if (props.indexOf(prop.toLowerCase()) !== -1) {\n return\n }\n\n stylelint.utils.report({\n message: messages.rejected(prop),\n node: decl,\n result,\n ruleName\n })\n })\n }\n}\n","import cssPropertyNoUnknown from './css-property-no-unknown/index.js'\nimport fontWeightNoIgnoredValues from './font-weight-no-ignored-values/index.js'\nimport lineHeightNoValueWithoutUnit from './line-height-no-value-without-unit/index.js'\nimport stylePropertyNoUnknown from './style-property-no-unknown/index.js'\n\nexport default {\n 'font-weight-no-ignored-values': fontWeightNoIgnoredValues,\n 'css-property-no-unknown': cssPropertyNoUnknown,\n 'style-property-no-unknown': stylePropertyNoUnknown,\n 'line-height-no-value-without-unit': lineHeightNoValueWithoutUnit\n}\n","import stylelint from 'stylelint'\n\nimport rules from './rules/index.js'\nimport { namespace } from './utils/index.js'\n\nconst rulesPlugins = Object.keys(rules).map((ruleName) => {\n return stylelint.createPlugin(namespace(ruleName), rules[ruleName])\n})\n\nexport default rulesPlugins\n"],"names":["ruleName","messages","props","allCSS2RNProps","allProps"],"mappings":";;;;;;;;AAAO,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,KAClC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;;ACDxD;;;;;AAKG;AACa,SAAA,oBAAoB,CAAE,MAAM,gBAAc;AACxD,IAAA,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACzB,QAAA,OAAO,IAAI,CAAA;KACZ;AAED,IAAA,OAAO,KAAK,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