eslint-plugin-mpx 0.2.25 → 0.2.26

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.
@@ -257,7 +257,7 @@ module.exports = {
257
257
  const properties = node.arguments[0].properties
258
258
  if (!properties) return
259
259
  for (const element of properties) {
260
- if (element.key.name === 'initData') {
260
+ if (element.key && element.key.name === 'initData') {
261
261
  hasInitData = 1
262
262
  }
263
263
  }
@@ -276,17 +276,17 @@ module.exports = {
276
276
  Array.isArray(node.properties)
277
277
  if (isinit) {
278
278
  for (const item of node.properties) {
279
- if (item.key.name === 'initData') {
279
+ if (item.key && item.key.name === 'initData') {
280
280
  handleInitData(item.value.properties, propsSet)
281
281
  }
282
282
  }
283
283
  }
284
284
  },
285
285
  Property(node) {
286
- if (node.key.name === 'computed') {
286
+ if (node.key && node.key.name === 'computed') {
287
287
  commonFunction(node.value, computedSet)
288
288
  }
289
- if (node.key.name === 'initData') {
289
+ if (node.key && node.key.name === 'initData') {
290
290
  const isCreate =
291
291
  node.parent.parent.callee &&
292
292
  node.parent.parent.callee.name === 'createComponent'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-mpx",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "Official ESLint plugin for Mpx.js",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",