eslint-plugin-mpx 0.2.27 → 0.2.29

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
  }
@@ -596,7 +596,7 @@ module.exports = {
596
596
  },
597
597
 
598
598
  /**
599
- * Check whether the given directive attribute has their empty value (`=""`).
599
+ * Check whether the given directive attribute has their empty value (`=""` or `="{{}}"`).
600
600
  * @param {VDirective} node The directive attribute node to check.
601
601
  * @param {RuleContext} context The rule context to use parser services.
602
602
  * @returns {boolean} `true` if the directive attribute has their empty value (`=""`).
@@ -605,9 +605,9 @@ module.exports = {
605
605
  if (node.value == null) {
606
606
  return false
607
607
  }
608
- if (node.value.expression != null) {
609
- return false
610
- }
608
+ // if (node.value.expression != null) { // expression 可能是空字符串
609
+ // return false
610
+ // }
611
611
 
612
612
  let valueText = context.getSourceCode().getText(node.value)
613
613
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-mpx",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "Official ESLint plugin for Mpx.js",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "eslint-utils": "^2.1.0",
53
- "mpx-eslint-parser": "^0.0.14",
53
+ "mpx-eslint-parser": "^0.0.17",
54
54
  "natural-compare": "^1.4.0",
55
55
  "semver": "^7.3.2"
56
56
  },