stylelint-taro 4.0.0-beta.13 → 4.0.0-beta.130
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/README.md +175 -0
- package/dist/config.d.ts +1 -0
- package/dist/index.cjs.js +257 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +253 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/platform/constrant.d.ts +4 -0
- package/dist/platform/h5.d.ts +3 -0
- package/dist/platform/harmony.d.ts +3 -0
- package/dist/platform/miniprogram.d.ts +3 -0
- package/dist/platform/rn.d.ts +3 -0
- package/dist/platform/type.d.ts +14 -0
- package/dist/rules/declaration-property-value-allowed-list/index.d.ts +7 -0
- package/dist/rules/declaration-property-value-allowed-list/index.js +80 -0
- package/dist/rules/declaration-property-value-allowed-list/index.js.map +1 -0
- package/dist/rules/index.d.ts +6 -0
- package/dist/rules/index.js +12 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/no-nested-selectors/index.d.ts +7 -0
- package/dist/rules/no-nested-selectors/index.js +39 -0
- package/dist/rules/no-nested-selectors/index.js.map +1 -0
- package/dist/rules/property-allowed-list/index.d.ts +7 -0
- package/dist/rules/property-allowed-list/index.js +78 -0
- package/dist/rules/property-allowed-list/index.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/{lib → dist}/utils/index.js +6 -14
- package/dist/utils/index.js.map +1 -0
- package/package.json +26 -46
- package/lib/config.js +0 -121
- package/lib/index.js +0 -12
- package/lib/platform/constrant.js +0 -7
- package/lib/platform/h5.js +0 -4
- package/lib/platform/harmony.js +0 -108
- package/lib/platform/miniprogram.js +0 -4
- package/lib/platform/rn.js +0 -29
- package/lib/platform/type.js +0 -2
- package/lib/rules/declaration-property-value-allowed-list/index.js +0 -83
- package/lib/rules/index.js +0 -14
- package/lib/rules/no-nested-selectors/index.js +0 -61
- package/lib/rules/property-allowed-list/index.js +0 -81
- package/src/config.ts +0 -136
- package/src/index.ts +0 -10
- package/src/platform/constrant.ts +0 -4
- package/src/platform/h5.ts +0 -7
- package/src/platform/harmony.ts +0 -109
- package/src/platform/miniprogram.ts +0 -7
- package/src/platform/rn.ts +0 -31
- package/src/platform/type.ts +0 -9
- package/src/rules/declaration-property-value-allowed-list/index.ts +0 -98
- package/src/rules/index.ts +0 -11
- package/src/rules/no-nested-selectors/index.ts +0 -46
- package/src/rules/property-allowed-list/index.ts +0 -94
- package/src/utils/index.ts +0 -69
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.
|
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ yarn add -D stylelint-taro
|
|
|
12
12
|
|
|
13
13
|
## 使用
|
|
14
14
|
|
|
15
|
+
项目根目录添加文件 `.stylelintrc.js`
|
|
16
|
+
|
|
15
17
|
```js
|
|
16
18
|
// .stylelintrc.js
|
|
17
19
|
const mergeConfig = require('stylelint-taro/lib/config')
|
|
@@ -112,3 +114,176 @@ module.exports = mergeConfig(['harmony', 'rn'], {})
|
|
|
112
114
|
"stylelint.validate": ["css", "sass", "scss", "less", "postcss"]
|
|
113
115
|
}
|
|
114
116
|
```
|
|
117
|
+
|
|
118
|
+
## 样式支持情况
|
|
119
|
+
|
|
120
|
+
| 类型 | 举例合法值 | 备注 |
|
|
121
|
+
| ------ | ------------------------------------------------ | :-----------------: |
|
|
122
|
+
| Length | 10px、10vw、10vh、100%、10rem、calc(100% - 20px) | 1rem = 16px |
|
|
123
|
+
| Color | #f00、rgb(0,0,0)、rgba(0,0,0,0.2)、green | 暂不支持 hsl 等方法 |
|
|
124
|
+
| Border | '1px solid #f00' | 符合 w3c 规范 |
|
|
125
|
+
|
|
126
|
+
### 通用属性
|
|
127
|
+
|
|
128
|
+
所有元素都支持的样式:
|
|
129
|
+
|
|
130
|
+
| 属性 | 可选值 / 单位 | 支持情况 |
|
|
131
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | :------: |
|
|
132
|
+
| flex | `flexGrow flexShrink flexBasis` | ✔️ |
|
|
133
|
+
| flex-grow | Number | ✔️ |
|
|
134
|
+
| flex-shrink | Number | ✔️ |
|
|
135
|
+
| flex-basis | Length | ✔️ |
|
|
136
|
+
| flex-direction | 'row','row-reverse','column','column-reverse' | ✔️ |
|
|
137
|
+
| justify-content | 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly' | ✔️ |
|
|
138
|
+
| align-content | 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly' | ✔️ |
|
|
139
|
+
| alignitems | 'flex-start', 'flex-end', 'center', 'baseline', 'stretch' , 'auto' | ✔️ |
|
|
140
|
+
| align-self | 'flex-start', 'flex-end', 'center', 'baseline', 'stretch' , 'auto' | ✔️ |
|
|
141
|
+
| flex-wrap | 'nowrap', 'wrap', 'wrap-reverse' | ❌ |
|
|
142
|
+
| position | 'relative', 'absolute' | ✔️ |
|
|
143
|
+
| left | Length | ✔️ |
|
|
144
|
+
| top | Length | ❌ |
|
|
145
|
+
| right | Length | ❌ |
|
|
146
|
+
| z-zndex | Number | ✔️ |
|
|
147
|
+
| bottom | Length | ✔️ |
|
|
148
|
+
| margin | Length \ Length Length \ Length Length Length \ Length Length Length Length | ✔️ |
|
|
149
|
+
| margin-top | Length | ✔️ |
|
|
150
|
+
| margin-right | Length | ✔️ |
|
|
151
|
+
| margin-bottom | Length | ✔️ |
|
|
152
|
+
| margin-left | Length | ✔️ |
|
|
153
|
+
| padding | Length \ Length Length \ Length Length Length \ Length Length Length Length | ✔️ |
|
|
154
|
+
| padding-top | Length | ✔️ |
|
|
155
|
+
| padding-right | Length | ✔️ |
|
|
156
|
+
| padding-bottom | Length | ✔️ |
|
|
157
|
+
| padding-left | Length | ✔️ |
|
|
158
|
+
| width | Length | ✔️ |
|
|
159
|
+
| height | Length | ✔️ |
|
|
160
|
+
| min-height | Length | ✔️ |
|
|
161
|
+
| min-width | Length | ✔️ |
|
|
162
|
+
| max-height | Length | ✔️ |
|
|
163
|
+
| max-eidth | Length | ✔️ |
|
|
164
|
+
| background | | ✔️ |
|
|
165
|
+
| background-color | Color | ✔️ |
|
|
166
|
+
| background-image | "src('xxx')", "linear-gradient(xxx)" 支持图片资源和线性渐变 " | ✔️ |
|
|
167
|
+
| background-size | 'cover', 'contain', Length(x y), Length(x) Length(y) | ✔️ |
|
|
168
|
+
| background-position | center', 'top', 'bottom', 'left', 'right', , Length(x y), Length(x) Length(y) | ✔️ |
|
|
169
|
+
| background-repeat | 'repeat', 'no-repeat', 'repeat-x', 'repeat-y' | ✔️ |
|
|
170
|
+
| border | Border(可设置 4 个值,控制 4 个方向) | ✔️ |
|
|
171
|
+
| border-top | Border | ✔️ |
|
|
172
|
+
| border-left | Border | ✔️ |
|
|
173
|
+
| border-right | Border | ✔️ |
|
|
174
|
+
| border-bottom | Border | ✔️ |
|
|
175
|
+
| border-color | Color(可设置 4 个值,控制 4 个方向) | ✔️ |
|
|
176
|
+
| border-top-color | Color | ✔️ |
|
|
177
|
+
| border-right-color | Color | ✔️ |
|
|
178
|
+
| border-bottom-color | Color | ✔️ |
|
|
179
|
+
| border-left-color | Color | ✔️ |
|
|
180
|
+
| border-radius | Length(可设置 4 个值,控制 4 个方向) | ✔️ |
|
|
181
|
+
| border-top-left-radius | Length | ✔️ |
|
|
182
|
+
| border-top-right-radius | Length | ✔️ |
|
|
183
|
+
| border-bottom-left-radius | Length | ✔️ |
|
|
184
|
+
| border-bottom-right-radius | Length | ✔️ |
|
|
185
|
+
| border-style | 'dotted', 'dashed', 'solid' (4 个值,控制 4 个方向) | ✔️ |
|
|
186
|
+
| border-top-style | 'dotted', 'dashed', 'solid' | ✔️ |
|
|
187
|
+
| border-right-style | 'dotted', 'dashed', 'solid' | ✔️ |
|
|
188
|
+
| border-bottom-style | 'dotted', 'dashed', 'solid' | ✔️ |
|
|
189
|
+
| border-left-style | 'dotted', 'dashed', 'solid' | ✔️ |
|
|
190
|
+
| opacity | Number | ✔️ |
|
|
191
|
+
| display | 'flex', 'none', 'block' | ✔️ |
|
|
192
|
+
| display | 'inline-block', 'inline-flex', 'inline' | ❌ |
|
|
193
|
+
| overflow | 'hidden', 'visible' | ✔️ |
|
|
194
|
+
| transform | translate、translateX、translateY、translateZ、translate2d、translate3d、scale、scaleX、scaleY、scale3d、rotate、rotateX、rotateY、rotate3d | ✔️ |
|
|
195
|
+
| transform-origin | Length Length | ✔️ |
|
|
196
|
+
| content | | ✔️ |
|
|
197
|
+
|
|
198
|
+
⚠️ 注意:
|
|
199
|
+
|
|
200
|
+
- `transform` 不允许连续出现 2 个同类型如:transform: translate(20px 20px) translate3d(10px, 30px, 30px)
|
|
201
|
+
- `display` 不支持**行内**
|
|
202
|
+
- 定位不支持 **bottom** 和 **right**
|
|
203
|
+
|
|
204
|
+
### 文本样式
|
|
205
|
+
|
|
206
|
+
| 属性 | 可选值 / 单位 | 支持情况 |
|
|
207
|
+
| ------------------ | ------------------------------------------------------- | :------: |
|
|
208
|
+
| font-size | Length | ✔️ |
|
|
209
|
+
| font-family | | ✔️ |
|
|
210
|
+
| font-style | 'normal', 'italic' | ✔️ |
|
|
211
|
+
| font-weight | 100~900, 'bold','bolder','light','lighter','normal' | ✔️ |
|
|
212
|
+
| line-height | 'XXpx' (需要指定具体指,不支持 Number) | ✔️ |
|
|
213
|
+
| text-align | 'center', 'left', 'right' | ✔️ |
|
|
214
|
+
| text-decoration | ('none', 'underline', 'line-through', 'overline') Color | ✔️ |
|
|
215
|
+
| text-overflow | 'ellipsis', 'clip' | ✔️ |
|
|
216
|
+
| color | Color | ✔️ |
|
|
217
|
+
| -webkit-line-clamp | Number | ✔️ |
|
|
218
|
+
|
|
219
|
+
⚠️ 注意:
|
|
220
|
+
|
|
221
|
+
- 文本样式 **仅对`<Text></Text>`节点生效**
|
|
222
|
+
- 文本样式 **不支持继承**
|
|
223
|
+
- `line-height`**不支持数值**
|
|
224
|
+
|
|
225
|
+
**以下两种情况是正确的对文本进行样式添加的案例:**
|
|
226
|
+
|
|
227
|
+
1.直接将样式添加在`<Text/>`上
|
|
228
|
+
|
|
229
|
+
```jsx
|
|
230
|
+
// ✅ 允许
|
|
231
|
+
<Text className="txt">hello</Text>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
2.样式添加到`<View/>`下是一个文本内容
|
|
235
|
+
|
|
236
|
+
```jsx
|
|
237
|
+
// ✅ 允许
|
|
238
|
+
<View className="txt">hello</View>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**错误案例:**
|
|
242
|
+
|
|
243
|
+
```jsx
|
|
244
|
+
// ❌ hello 父级没有添加文本样式,txt的文本属性无法继承下去
|
|
245
|
+
<View className="txt">
|
|
246
|
+
<Text>hello</Text>
|
|
247
|
+
</View>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## CSS 选择器
|
|
251
|
+
|
|
252
|
+
### 通用选择器
|
|
253
|
+
|
|
254
|
+
注意点:
|
|
255
|
+
|
|
256
|
+
- 支持**类选择器**,
|
|
257
|
+
- 不支持**ID 选择器、标签选择器、属性选择器**
|
|
258
|
+
|
|
259
|
+
| 选择器 | 示例 | 示例说明 | 支持情况 |
|
|
260
|
+
| ------------------ | ------------------- | ------------------------------------------------------------ | :------: |
|
|
261
|
+
| .class | .intro | 选择所有 class="intro" 的元素 | ✔️ |
|
|
262
|
+
| .class.class | .red.big | 选择所有 class="red big" 元素 | ✔️ |
|
|
263
|
+
| .class, .class | .item, .text | 选择所有 class="item" 元素和 class="text" 元素 | ✔️ |
|
|
264
|
+
| .class .class | .grandfather .child | 选择所有 class="grandfather" 内所有的 class="child" 的元素 | ✔️ |
|
|
265
|
+
| .class > .class | .parent > .child | 选择所有 父级是 class="parent"的 class="child" 元素 | ✔️ |
|
|
266
|
+
| .class+.class | .red+.big | 选择所有紧跟在 class="red" 元素之后的第一个 class="big" 元素 | ❌ |
|
|
267
|
+
| .class~.class | .red~.big | 选择所有紧跟在 class="red" 之后的每一个 class="big" 元素 | ❌ |
|
|
268
|
+
| #id | #firstname | 选择所有 id="firstname"的元素 | ❌ |
|
|
269
|
+
| \* | \* | 选择所有元素 | ❌ |
|
|
270
|
+
| element | p | 选择所有\<p>元素 | ❌ |
|
|
271
|
+
| \[attribute] | \[target] | 选择所有带有 target 属性元素 | ❌ |
|
|
272
|
+
| \[attribute=value] | \[target=blank] | 选择所有使用 target="blank"的元素 | ❌ |
|
|
273
|
+
| ... | | 其他 | ❌ |
|
|
274
|
+
|
|
275
|
+
### 伪类
|
|
276
|
+
|
|
277
|
+
- 支持**before、after**,
|
|
278
|
+
|
|
279
|
+
| 选择器 | 示例 | 示例说明 | 支持情况 |
|
|
280
|
+
| ----------------- | ------------------------ | ----------------------------------------------------------------- | :------: |
|
|
281
|
+
| :before | .intro:before | 在每个 class="intro" 元素之前插入内容 | ✔️ |
|
|
282
|
+
| :after | .intro:after | 在每个 class="intro" 元素之后插入内容 | ✔️ |
|
|
283
|
+
| :nth-child() | .intro:nth-child(2) | 选择 class="intro" 元素是其父级的第二个子元素 | ❌ |
|
|
284
|
+
| :nth-last-child() | .intro:nth-last-child(2) | 选择 class="intro" 元素是其父级的第二个子元素, 从最后一个子项计数 | ❌ |
|
|
285
|
+
| :first-child | .intro:first-child | 选择 class="intro" 元素是其父级的第一个子级 | ❌ |
|
|
286
|
+
| :last-child | .intro:last-child | 选择 class="intro" 元素是其父级的最后一个子级 | ❌ |
|
|
287
|
+
| :root | :root | 选择文档的根元素 | ❌ |
|
|
288
|
+
| :checked | input:checked | 选择每个选中的输入元素 | ❌ |
|
|
289
|
+
| ... | | 其他 | ❌ |
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var stylelint = require('stylelint');
|
|
6
|
+
var declarationValueIndex = require('stylelint/lib/utils/declarationValueIndex.cjs');
|
|
7
|
+
var matchesStringOrRegExp = require('stylelint/lib/utils/matchesStringOrRegExp.cjs');
|
|
8
|
+
var optionsMatches = require('stylelint/lib/utils/optionsMatches.cjs');
|
|
9
|
+
var validateObjectWithArrayProps = require('stylelint/lib/utils/validateObjectWithArrayProps.cjs');
|
|
10
|
+
var validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
|
|
11
|
+
var validateTypes_cjs = require('stylelint/lib/utils/validateTypes.cjs');
|
|
12
|
+
var vendor = require('stylelint/lib/utils/vendor.cjs');
|
|
13
|
+
var _ = require('lodash');
|
|
14
|
+
var isCustomProperty = require('stylelint/lib/utils/isCustomProperty.mjs');
|
|
15
|
+
var isStandardSyntaxProperty = require('stylelint/lib/utils/isStandardSyntaxProperty.mjs');
|
|
16
|
+
var matchesStringOrRegExp$1 = require('stylelint/lib/utils/matchesStringOrRegExp.mjs');
|
|
17
|
+
var validateObjectWithArrayProps$1 = require('stylelint/lib/utils/validateObjectWithArrayProps.mjs');
|
|
18
|
+
var validateOptions$1 = require('stylelint/lib/utils/validateOptions.mjs');
|
|
19
|
+
var validateTypes_mjs = require('stylelint/lib/utils/validateTypes.mjs');
|
|
20
|
+
var vendor$1 = require('stylelint/lib/utils/vendor.mjs');
|
|
21
|
+
|
|
22
|
+
function taroDocsUrl(_) {
|
|
23
|
+
return `https://taro-docs.jd.com/docs/`;
|
|
24
|
+
}
|
|
25
|
+
function nameSpace(ruleName) {
|
|
26
|
+
// 前缀视个人情况而定
|
|
27
|
+
return `taro/${ruleName}`;
|
|
28
|
+
}
|
|
29
|
+
function report(problem) {
|
|
30
|
+
return stylelint.utils.report(problem);
|
|
31
|
+
}
|
|
32
|
+
function log(text) {
|
|
33
|
+
// vscode下不添加颜色
|
|
34
|
+
if (!process.env.TARO_ENV) {
|
|
35
|
+
return text;
|
|
36
|
+
}
|
|
37
|
+
return text;
|
|
38
|
+
// return highlightQuotaValue(text)
|
|
39
|
+
}
|
|
40
|
+
function findIntersection(data) {
|
|
41
|
+
const keys = Object.keys(data);
|
|
42
|
+
let intersection = {};
|
|
43
|
+
if (keys.length > 1) {
|
|
44
|
+
const firstKey = keys[0];
|
|
45
|
+
const firstProps = data[firstKey];
|
|
46
|
+
for (const prop in firstProps) {
|
|
47
|
+
const firstValues = firstProps[prop];
|
|
48
|
+
let commonValues = firstValues || [];
|
|
49
|
+
for (let i = 1; i < keys.length; i++) {
|
|
50
|
+
const currentKey = keys[i];
|
|
51
|
+
const currentProps = data[currentKey];
|
|
52
|
+
const currentValues = currentProps[prop];
|
|
53
|
+
if (Array.isArray(commonValues)) {
|
|
54
|
+
if (Array.isArray(currentValues)) {
|
|
55
|
+
commonValues = commonValues.filter(value => currentValues.includes(value));
|
|
56
|
+
}
|
|
57
|
+
else if (currentValues) {
|
|
58
|
+
commonValues = commonValues.filter(value => currentValues === true || currentValues.includes(value));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (commonValues === true) {
|
|
62
|
+
commonValues = currentValues || [];
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
commonValues = [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (commonValues.length > 0) {
|
|
69
|
+
intersection[prop] = commonValues;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
intersection = data[keys[0]];
|
|
75
|
+
}
|
|
76
|
+
return { intersection };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const ruleName$2 = nameSpace('declaration-property-value-allowed-list');
|
|
80
|
+
const messages$2 = stylelint.utils.ruleMessages(ruleName$2, {
|
|
81
|
+
rejected: (property, value, platfrom) => log(`"${property}" 暂不支持值 "${value}",受限端: "${platfrom}"`)
|
|
82
|
+
});
|
|
83
|
+
const meta$2 = {
|
|
84
|
+
// TODO: 使用Taro文档的规则
|
|
85
|
+
url: taroDocsUrl(),
|
|
86
|
+
};
|
|
87
|
+
const rule$2 = (primary) => {
|
|
88
|
+
return (root, result) => {
|
|
89
|
+
const validOptions = Object.keys(primary).every((key) => {
|
|
90
|
+
if (primary[key]) {
|
|
91
|
+
return validateOptions(result, ruleName$2, {
|
|
92
|
+
actual: primary[key],
|
|
93
|
+
possible: [validateObjectWithArrayProps(validateTypes_cjs.isString, validateTypes_cjs.isRegExp, validateTypes_cjs.isBoolean)],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
});
|
|
98
|
+
if (!validOptions) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const { intersection } = findIntersection(primary);
|
|
102
|
+
Object.keys(intersection).forEach(key => {
|
|
103
|
+
if (intersection[key] === true) {
|
|
104
|
+
delete intersection[key];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const propKeys = Object.keys(intersection);
|
|
108
|
+
// 在这里可以添加额外的逻辑
|
|
109
|
+
root.walkDecls(decl => {
|
|
110
|
+
const { prop, value } = decl;
|
|
111
|
+
const unprefixedProp = vendor.unprefixed(prop);
|
|
112
|
+
const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key));
|
|
113
|
+
if (propPatterns.length === 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (propPatterns.some((pattern) => optionsMatches(intersection, pattern, value))) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const platforms = [];
|
|
120
|
+
Object.keys(primary).forEach((platform) => {
|
|
121
|
+
if (primary[platform]) {
|
|
122
|
+
if (propPatterns.some((pattern) => {
|
|
123
|
+
return optionsMatches(primary[platform], pattern, value) || primary[platform][pattern] === true;
|
|
124
|
+
})) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
platforms.push(platform);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
const index = declarationValueIndex(decl);
|
|
131
|
+
const endIndex = index + decl.value.length;
|
|
132
|
+
report({
|
|
133
|
+
message: messages$2.rejected(prop, value, platforms.join(', ')),
|
|
134
|
+
node: decl,
|
|
135
|
+
index,
|
|
136
|
+
endIndex,
|
|
137
|
+
result,
|
|
138
|
+
ruleName: ruleName$2,
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
rule$2.ruleName = ruleName$2;
|
|
144
|
+
rule$2.messages = messages$2;
|
|
145
|
+
rule$2.meta = meta$2;
|
|
146
|
+
|
|
147
|
+
const ruleName$1 = nameSpace('no-nested-selectors');
|
|
148
|
+
const messages$1 = stylelint.utils.ruleMessages(ruleName$1, {
|
|
149
|
+
rejected: (selector, platfrom) => log(`"${selector}" 仅能使用单个class选择器,受限端 "${platfrom}"`)
|
|
150
|
+
});
|
|
151
|
+
const meta$1 = {
|
|
152
|
+
// TODO: 使用Taro文档的规则
|
|
153
|
+
url: taroDocsUrl(),
|
|
154
|
+
};
|
|
155
|
+
const rule$1 = (primary) => {
|
|
156
|
+
return (root, result) => {
|
|
157
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName$1, {
|
|
158
|
+
actual: primary
|
|
159
|
+
});
|
|
160
|
+
if (!validOptions) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const platform = ['harmony', 'rn'];
|
|
164
|
+
root.walkRules(ruleNode => {
|
|
165
|
+
const selector = ruleNode.selector;
|
|
166
|
+
if (!/^[.#]?[a-zA-Z0-9_-]+$/.test(selector)) {
|
|
167
|
+
report({
|
|
168
|
+
ruleName: ruleName$1,
|
|
169
|
+
result,
|
|
170
|
+
node: ruleNode,
|
|
171
|
+
message: messages$1.rejected(selector, platform.join(', ')),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
rule$1.ruleName = ruleName$1;
|
|
178
|
+
rule$1.messages = messages$1;
|
|
179
|
+
rule$1.meta = meta$1;
|
|
180
|
+
|
|
181
|
+
const ruleName = nameSpace('property-allowed-list');
|
|
182
|
+
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
183
|
+
rejected: (property, platfrom) => log(`"${property}" 暂不支持该属性,受限端 "${platfrom}"`)
|
|
184
|
+
});
|
|
185
|
+
const meta = {
|
|
186
|
+
// TODO: 使用Taro文档的规则
|
|
187
|
+
url: taroDocsUrl(),
|
|
188
|
+
};
|
|
189
|
+
const rule = (primary) => {
|
|
190
|
+
return (root, result) => {
|
|
191
|
+
const validOptions = Object.keys(primary).every((key) => {
|
|
192
|
+
if (primary[key]) {
|
|
193
|
+
return validateOptions$1(result, ruleName, {
|
|
194
|
+
actual: primary[key],
|
|
195
|
+
possible: [validateObjectWithArrayProps$1(validateTypes_mjs.isString, validateTypes_mjs.isRegExp, validateTypes_mjs.isBoolean)],
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
});
|
|
200
|
+
if (!validOptions) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const _arr = [];
|
|
204
|
+
Object.keys(primary).forEach(key => {
|
|
205
|
+
_arr.push(...Object.keys(primary[key]));
|
|
206
|
+
});
|
|
207
|
+
const intersectionKeys = _.intersection(_arr);
|
|
208
|
+
// 在这里可以添加额外的逻辑
|
|
209
|
+
root.walkDecls(decl => {
|
|
210
|
+
const prop = decl.prop;
|
|
211
|
+
if (!isStandardSyntaxProperty(prop)) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (isCustomProperty(prop)) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// either the prefix or unprefixed version is in the list
|
|
218
|
+
if (matchesStringOrRegExp$1([prop, vendor$1.unprefixed(prop)], intersectionKeys)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const platform = [];
|
|
222
|
+
Object.keys(primary).forEach(key => {
|
|
223
|
+
if (primary[key]) {
|
|
224
|
+
const platformKeys = Object.keys(primary[key]);
|
|
225
|
+
if (platformKeys.length > 0) {
|
|
226
|
+
if (!platformKeys.includes(prop)) {
|
|
227
|
+
platform.push(key);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
report({
|
|
233
|
+
message: messages.rejected(prop, platform.join(', ')),
|
|
234
|
+
word: prop,
|
|
235
|
+
node: decl,
|
|
236
|
+
result,
|
|
237
|
+
ruleName,
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
rule.ruleName = ruleName;
|
|
243
|
+
rule.messages = messages;
|
|
244
|
+
rule.meta = meta;
|
|
245
|
+
|
|
246
|
+
const rules = {
|
|
247
|
+
'no-nested-selectors': rule$1,
|
|
248
|
+
'property-allowed-list': rule,
|
|
249
|
+
'declaration-property-value-allowed-list': rule$2,
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const rulesPlugins = Object.keys(rules).map(ruleName => {
|
|
253
|
+
return stylelint.createPlugin(nameSpace(ruleName), rules[ruleName]);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
exports.default = rulesPlugins;
|
|
257
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/utils/index.ts","../src/rules/declaration-property-value-allowed-list/index.ts","../src/rules/no-nested-selectors/index.ts","../src/rules/property-allowed-list/index.ts","../src/rules/index.ts","../src/index.ts"],"sourcesContent":["import stylelint from 'stylelint'\n\nimport type { Problem } from 'stylelint'\n\nexport function taroDocsUrl(_: string) {\n return `https://taro-docs.jd.com/docs/`\n}\n\nexport function nameSpace(ruleName: string) {\n // 前缀视个人情况而定\n return `taro/${ruleName}`\n}\nexport function newMessage(ruleName: string, options) {\n return stylelint.utils.ruleMessages(ruleName, options)\n}\n\nexport function report(problem: Problem) {\n return stylelint.utils.report(problem)\n}\n\nexport function log(text: string) {\n // vscode下不添加颜色\n if (!process.env.TARO_ENV) {\n return text\n }\n return text\n // return highlightQuotaValue(text)\n}\n\nexport function findIntersection(data) {\n const keys = Object.keys(data)\n let intersection = {}\n\n if (keys.length > 1) {\n const firstKey = keys[0]\n const firstProps = data[firstKey]\n\n for (const prop in firstProps) {\n const firstValues = firstProps[prop]\n let commonValues = firstValues || []\n\n for (let i = 1; i < keys.length; i++) {\n const currentKey = keys[i]\n const currentProps = data[currentKey]\n const currentValues = currentProps[prop]\n\n if (Array.isArray(commonValues)) {\n if (Array.isArray(currentValues)) {\n commonValues = commonValues.filter(value => currentValues.includes(value))\n } else if (currentValues) {\n commonValues = commonValues.filter(value => currentValues === true || currentValues.includes(value))\n }\n } else if (commonValues === true) {\n commonValues = currentValues || []\n } else {\n commonValues = []\n }\n }\n\n if (commonValues.length > 0) {\n intersection[prop] = commonValues\n }\n }\n } else {\n intersection = data[keys[0]]\n }\n\n return { intersection }\n}\n","import stylelint from 'stylelint'\nimport declarationValueIndex from 'stylelint/lib/utils/declarationValueIndex.cjs'\nimport matchesStringOrRegExp from 'stylelint/lib/utils/matchesStringOrRegExp.cjs'\nimport optionsMatches from 'stylelint/lib/utils/optionsMatches.cjs'\nimport validateObjectWithArrayProps from 'stylelint/lib/utils/validateObjectWithArrayProps.cjs'\nimport validateOptions from 'stylelint/lib/utils/validateOptions.cjs'\nimport { isBoolean, isRegExp, isString } from 'stylelint/lib/utils/validateTypes.cjs'\nimport vendor from 'stylelint/lib/utils/vendor.cjs'\n\nimport { findIntersection, log, nameSpace, report, taroDocsUrl } from '../../utils/index.ts'\n\nimport type { Rule } from 'stylelint'\n\nexport const ruleName = nameSpace('declaration-property-value-allowed-list')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (property, value, platfrom) => log(`\"${property}\" 暂不支持值 \"${value}\",受限端: \"${platfrom}\"`)\n})\n\nconst meta = {\n // TODO: 使用Taro文档的规则\n url: taroDocsUrl('declaration-property-value-allowed-list'),\n}\n\nconst rule: Rule = (primary) => {\n return (root, result) => {\n const validOptions = Object.keys(primary).every((key) => {\n if (primary[key]) {\n return validateOptions(result, ruleName, {\n actual: primary[key],\n possible: [validateObjectWithArrayProps(isString, isRegExp, isBoolean)],\n })\n }\n return true\n })\n\n if (!validOptions) {\n return\n }\n\n const { intersection } = findIntersection(primary)\n\n Object.keys(intersection).forEach(key => {\n if (intersection[key] === true) {\n delete intersection[key]\n }\n })\n const propKeys = Object.keys(intersection)\n\n // 在这里可以添加额外的逻辑\n root.walkDecls(decl => {\n const { prop, value } = decl\n\n const unprefixedProp = vendor.unprefixed(prop)\n const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key))\n\n if (propPatterns.length === 0) {\n return\n }\n\n if (propPatterns.some((pattern) => optionsMatches(intersection, pattern, value))) {\n return\n }\n\n const platforms: string[] = []\n Object.keys(primary).forEach((platform) => {\n if (primary[platform]) {\n if (propPatterns.some((pattern) => {\n return optionsMatches(primary[platform], pattern, value) || primary[platform][pattern] === true\n })) {\n return\n }\n platforms.push(platform)\n }\n })\n\n const index = declarationValueIndex(decl)\n const endIndex = index + decl.value.length\n\n report({\n message: messages.rejected(prop, value, platforms.join(', ')),\n node: decl,\n index,\n endIndex,\n result,\n ruleName,\n })\n })\n }\n}\n\nrule.ruleName = ruleName\nrule.messages = messages\nrule.meta = meta\n\nexport default rule\n","import stylelint from 'stylelint'\n\nimport { log, nameSpace, report, taroDocsUrl } from '../../utils/index.ts'\n\nimport type { Rule } from 'stylelint'\n\nexport const ruleName = nameSpace('no-nested-selectors')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (selector, platfrom) => log(`\"${selector}\" 仅能使用单个class选择器,受限端 \"${platfrom}\"`)\n})\n\nconst meta = {\n // TODO: 使用Taro文档的规则\n url: taroDocsUrl('no-nested-selectors'),\n}\n\nconst rule: Rule = (primary) => {\n return (root, result) => {\n const validOptions = stylelint.utils.validateOptions(result, ruleName, {\n actual: primary\n })\n if (!validOptions) {\n return\n }\n const platform = ['harmony', 'rn']\n\n root.walkRules(ruleNode => {\n const selector = ruleNode.selector\n if (!/^[.#]?[a-zA-Z0-9_-]+$/.test(selector)) {\n report({\n ruleName,\n result,\n node: ruleNode,\n message: messages.rejected(selector, platform.join(', ')),\n })\n }\n })\n }\n}\n\nrule.ruleName = ruleName\nrule.messages = messages\nrule.meta = meta\n\nexport default rule\n","import _ from 'lodash'\nimport stylelint from 'stylelint'\nimport isCustomProperty from 'stylelint/lib/utils/isCustomProperty.mjs'\nimport isStandardSyntaxProperty from 'stylelint/lib/utils/isStandardSyntaxProperty.mjs'\nimport matchesStringOrRegExp from 'stylelint/lib/utils/matchesStringOrRegExp.mjs'\nimport validateObjectWithArrayProps from 'stylelint/lib/utils/validateObjectWithArrayProps.mjs'\nimport validateOptions from 'stylelint/lib/utils/validateOptions.mjs'\nimport { isBoolean, isRegExp, isString } from 'stylelint/lib/utils/validateTypes.mjs'\nimport vendor from 'stylelint/lib/utils/vendor.mjs'\n\nimport { log, nameSpace, report, taroDocsUrl } from '../../utils/index.ts'\n\nimport type { Rule } from 'stylelint'\n\nexport const ruleName = nameSpace('property-allowed-list')\n\nexport const messages = stylelint.utils.ruleMessages(ruleName, {\n rejected: (property, platfrom) => log(`\"${property}\" 暂不支持该属性,受限端 \"${platfrom}\"`)\n})\n\nconst meta = {\n // TODO: 使用Taro文档的规则\n url: taroDocsUrl('property-allowed-list'),\n}\n\nconst rule: Rule = (primary) => {\n return (root, result) => {\n const validOptions = Object.keys(primary).every((key) => {\n if (primary[key]) {\n return validateOptions(result, ruleName, {\n actual: primary[key],\n possible: [validateObjectWithArrayProps(isString, isRegExp, isBoolean)],\n })\n }\n return true\n })\n\n if (!validOptions) {\n return\n }\n\n const _arr: string[] = []\n Object.keys(primary).forEach(key => {\n _arr.push(...Object.keys(primary[key]))\n })\n const intersectionKeys = _.intersection(_arr)\n\n // 在这里可以添加额外的逻辑\n root.walkDecls(decl => {\n const prop = decl.prop\n\n if (!isStandardSyntaxProperty(prop)) {\n return\n }\n\n if (isCustomProperty(prop)) {\n return\n }\n\n // either the prefix or unprefixed version is in the list\n if (matchesStringOrRegExp([prop, vendor.unprefixed(prop)], intersectionKeys)) {\n return\n }\n\n const platform: string[] = []\n Object.keys(primary).forEach(key => {\n if (primary[key]) {\n const platformKeys = Object.keys(primary[key])\n if (platformKeys.length > 0) {\n if (!platformKeys.includes(prop)) {\n platform.push(key)\n }\n }\n }\n })\n\n report({\n message: messages.rejected(prop, platform.join(', ')),\n word: prop,\n node: decl,\n result,\n ruleName,\n })\n })\n }\n}\n\nrule.ruleName = ruleName\nrule.messages = messages\nrule.meta = meta\n\nexport default rule\n","import declarationPropertyValueAllowedList from './declaration-property-value-allowed-list/index.ts'\nimport noNestedSelectors from './no-nested-selectors/index.ts'\nimport propertyAllowedList from './property-allowed-list/index.ts'\n\nconst rules = {\n 'no-nested-selectors': noNestedSelectors,\n 'property-allowed-list': propertyAllowedList,\n 'declaration-property-value-allowed-list': declarationPropertyValueAllowedList,\n}\n\nexport default rules\n","import stylelint from 'stylelint'\n\nimport rules from './rules/index.ts'\nimport { nameSpace } from './utils/index.ts'\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","meta","rule","isString","isRegExp","isBoolean","validateOptions","validateObjectWithArrayProps","matchesStringOrRegExp","vendor","noNestedSelectors","propertyAllowedList","declarationPropertyValueAllowedList"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIM,SAAU,WAAW,CAAC,CAAS,EAAA;AACnC,IAAA,OAAO,gCAAgC,CAAA;AACzC,CAAC;AAEK,SAAU,SAAS,CAAC,QAAgB,EAAA;;IAExC,OAAO,CAAA,KAAA,EAAQ,QAAQ,CAAA,CAAE,CAAA;AAC3B,CAAC;AAKK,SAAU,MAAM,CAAC,OAAgB,EAAA;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACxC,CAAC;AAEK,SAAU,GAAG,CAAC,IAAY,EAAA;;AAE9B,IAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;AACzB,QAAA,OAAO,IAAI,CAAA;KACZ;AACD,IAAA,OAAO,IAAI,CAAA;;AAEb,CAAC;AAEK,SAAU,gBAAgB,CAAC,IAAI,EAAA;IACnC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,YAAY,GAAG,EAAE,CAAA;AAErB,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