Skip to content

'no-shared-component-data' false positive when using arrow functions #154

Closed
@bartcorremans

Description

@bartcorremans

Tell us about your environment

  • ESLint Version: 3.19.0
  • eslint-plugin-vue Version: 3.11.0
  • Node Version: 7.8.0

Please show your full configuration:

{
	root: true,
	extends: ['plugin:vue/recommended'],
	rules: {
		'vue/html-quotes': 'error',
		'vue/html-self-closing': ['error', {
			html: {
				normal: 'never',
				void: 'any',
				component: 'never'
			},
			svg: 'never',
			math: 'never'
		}],
		'vue/no-async-in-computed-properties': 'error',
		'vue/no-dupe-keys': 'error',
		'vue/no-duplicate-attributes': 'error',
		'vue/no-shared-component-data': 'error',
		'vue/order-in-components': 'error',
		'vue/v-bind-style': 'error',
		'vue/v-on-style': 'error'
	}
}

What did you do? Please include the actual source code causing the issue.

<script>
	export default {
		data: () => ({
			foo: 'bar'
		})
	};
</script>

What did you expect to happen?

No linting errors

What actually happened? Please include the actual, raw output from ESLint.

Error: data property in component must be a function

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions