-
-
Notifications
You must be signed in to change notification settings - Fork 679
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
vue/require-default-prop gives a false error with " as PropOptions<T>" with TypeScript #564
Labels
Comments
Thanks for posting this issue @wuservices I really like how you explained the problem. I confirmed it and it's due to the fact that |
armano2
added a commit
to armano2/eslint-plugin-vue
that referenced
this issue
Oct 17, 2018
michalsnik
pushed a commit
that referenced
this issue
Nov 6, 2018
* Add typescript specific changes * Add "as" helper * Fix vue/require-default-prop * Fix vue/require-prop-types * Allow to use `export default (Vue as VueConstructor<Vue>).extend({` syntax Fix issues: #564 #575 * Fix vue/require-prop-type-constructor * Fix vue/require-valid-default-prop * Add more tests in utils
@michalsnik can you close this ticket ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tell us about your environment
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
.eslintrc.js
, changeplugin:vue/essential
toplugin:vue/recommended
to get all rulesPropOptions
types toHelloWorld.vue
as seen below. In this example I usePropOptions<string>
, which is redundant (but still shows the problem). In practice, this would be a more complex type like an interface. Typings with Typescript 2.7.1 vue#7640 (comment) is where I got inspiration for this typing syntax.What did you expect to happen?
No errors that prop
msg
requires a default value to be set.What actually happened? Please include the actual, raw output from ESLint.
It looks like adding
as PropOptions<string>
trips up the parser such that it doesn't recognize that themsg
prop is required and therefore doesn't need a default valueThe text was updated successfully, but these errors were encountered: