eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

change request to [vue/require-component-is]

Open mesqueeb opened this issue 5 years ago • 1 comments

What rule do you want to change?

  • [vue/require-component-is]

Does this change cause the rule to produce more or fewer warnings?

  • fewer

How will the change be implemented? (New option, new default behavior, etc.)? not sure. I think an edit of the source code of this library will be required

Please provide some example code that this change will affect:

<component is="MyInput" >Hello</component>

What does the rule currently do for this code? image

What will the rule do after it's changed? not throw an error

Additional context

So basically, in Vue, props that can accept strings can passed two ways:

  • someprop="string-value"
  • :someprop="'string-value'"

These two are identical.

With <component is according to the docs, it can receive a component's name as string - of a component that's globally installed with Vue.component.

Therefore both these should be allowed by linting behaviour:

  • <component is="MyInput" />
  • <component :is="'MyInput'" />

But currently only the latter is allowed.

mesqueeb avatar Sep 03 '20 05:09 mesqueeb

This is the bugi came here to post. Thank you for this solution: @mesqueeb <component :is="'MyInput'" />

I will use this for now.

sugoidesune avatar Oct 20 '20 15:10 sugoidesune