eslint-plugin-mpx 0.2.27 → 0.2.28
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.
|
@@ -75,7 +75,7 @@ function checkInInitData(
|
|
|
75
75
|
// 属性值存在 || 说明有兜底,跳过检测
|
|
76
76
|
if (nodeName.includes('||')) return
|
|
77
77
|
// 检测当前属性值在initData 和 computedSet 导出情况,computedSet 返回不会解构出来,做一个兼容
|
|
78
|
-
if (!propsSet.has(nodeName) && computedSet.has(nodeName.split('.')[0])) {
|
|
78
|
+
if (!propsSet.has(nodeName) && computedSet.has(nodeName.split('.')?.[0])) {
|
|
79
79
|
context.report({
|
|
80
80
|
node,
|
|
81
81
|
messageId: 'unexpected',
|
|
@@ -192,7 +192,7 @@ module.exports = {
|
|
|
192
192
|
propsSet,
|
|
193
193
|
context,
|
|
194
194
|
node,
|
|
195
|
-
node.value.value.match(reg)[0],
|
|
195
|
+
node.value.value.match(reg)?.[0],
|
|
196
196
|
hasInitData
|
|
197
197
|
)
|
|
198
198
|
checkInitData(
|
|
@@ -201,7 +201,7 @@ module.exports = {
|
|
|
201
201
|
hasInitData,
|
|
202
202
|
context,
|
|
203
203
|
node,
|
|
204
|
-
node.value.value.match(reg)[0]
|
|
204
|
+
node.value.value.match(reg)?.[0]
|
|
205
205
|
)
|
|
206
206
|
}
|
|
207
207
|
}
|