Skip to content

valid-v-slot reporting errors on code that works #1165

Closed
@icleolion

Description

@icleolion

Tell us about your environment

  • ESLint version: 7.1.0
  • eslint-plugin-vue version: 6.2.2
  • Node version: 12.8.1

Please show your full configuration:

module.exports = {
	root: true,
	parserOptions: {
		parser: `babel-eslint`,
		ecmaVersion: 2017,
		sourceType: `module`,
	},
	env: {
		'node': true,
		'jquery': true,
	},
	extends: [
		`eslint:recommended`,
		`plugin:vue/recommended`,
	],
	ignorePatterns: [
		`!.*`,
		`node_modules/`,
		`wwwroot/`,
	],
	rules: {
		'vue/valid-v-slot': [`error`],
	},
}

What did you do?
The below codepen is taken from a code example within Vuetify's documentation (https://vuetifyjs.com/en/components/data-tables/#slots), where they use modifiers on a v-slot directive and therefore fall foul of the valid-v-slot rule.
https://codepen.io/icleolion/pen/ExVJGbv

What did you expect to happen?
As I implemented this code before I started using the rule, I knew the code worked as intended and therefore didn't expect to see the rule to show errors. As per a discussion in Vuetify's repository, they see this as a valid convention too. vuetifyjs/vuetify#11486 (comment)

What actually happened?
eslint-plugin-vue shows an error (as below) on code that works!
'v-slot' directive doesn't support any modifier. eslint(vue/valid-v-slot)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions