Skip to content

vue/no-use-computed-property-like-method - TypeError: Cannot read property 'valueType' of undefined #1649

Closed
@icleolion

Description

@icleolion

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 7.32.0
  • eslint-plugin-vue version: 7.19.0
  • Node version: 14.17.3
  • Operating System: Windows 10

Please show your full configuration:

module.exports = {
	root: true,
	parser: `vue-eslint-parser`,
	parserOptions: {
		parser: `@babel/eslint-parser`,
		ecmaVersion: 2020,
		sourceType: `module`,
	},
	env: {
		'node': true,
		'jquery': true,
	},
	extends: [
		`plugin:vue/recommended`,
	],
	ignorePatterns: [
		`!.*`,
		`node_modules/`,
		`wwwroot/`,
	],
	rules: {
		'vue/no-use-computed-property-like-method': [`error`],
	},
}

What did you do?

<template>
	<div></div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
	props: [`user`],
	computed: {
		...mapGetters(`auth`, [`statusForUser`]),
		status () {
			return this.statusForUser(this.user)
		},
	},
}
</script>

What did you expect to happen?
I expected for eslint to run without error.

What actually happened?
TypeError: Cannot read property 'valueType' of undefined
Occurred while linting C:\Test\ClientApp\components\a test folder\test.vue:13
at getValueType (C:\Test\node_modules\eslint-plugin-vue\lib\rules\no-use-computed-property-like-method.js:131:18)
at addPropertyMap (C:\Test\node_modules\eslint-plugin-vue\lib\rules\no-use-computed-property-like-method.js:181:18)
at Object.CallExpression > MemberExpression > ThisExpression (C:\Test\node_modules\eslint-plugin-vue\lib\rules\no-use-computed-property-like-method.js:227:9)
at callVisitor (C:\Test\node_modules\eslint-plugin-vue\lib\utils\index.js:982:21)
at vueVisitor. (C:\Test\node_modules\eslint-plugin-vue\lib\utils\index.js:989:35)
at C:\Test\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (C:\Test\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (C:\Test\node_modules\eslint\lib\linter\node-event-generator.js:293:26)
at NodeEventGenerator.applySelectors (C:\Test\node_modules\eslint\lib\linter\node-event-generator.js:322:22)

Repository to reproduce this issue
Not available

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions