Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bartcorremans opened this issue Aug 14, 2017 · 1 comment · Fixed by #156
Closed

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

bartcorremans opened this issue Aug 14, 2017 · 1 comment · Fixed by #156

Comments

@bartcorremans
Copy link

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

@armano2
Copy link
Contributor

armano2 commented Aug 14, 2017

arrow function should be allowed in this rule, because we are going to add vue/no-arrow-function #152

@mysticatea mysticatea added the bug label Aug 15, 2017
@michalsnik michalsnik added this to the Official release milestone Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants