Skip to content
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

Extend vue/require-valid-default-prop to check inside defineModel #2369

Open
seanogdev opened this issue Jan 15, 2024 · 1 comment
Open

Extend vue/require-valid-default-prop to check inside defineModel #2369

seanogdev opened this issue Jan 15, 2024 · 1 comment

Comments

@seanogdev
Copy link

What rule do you want to change?

Extend vue/require-valid-default-prop to check defineModel

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

Potentially the same

How will the change be implemented? (New option, new default behavior, etc.)?

Add support for defineModel to check that it has a default prop

Please provide some example code that this change will affect:

const modelValue = defineModel({
  type: Boolean,
  default: false,
});

What does the rule currently do for this code?

It does not check for a default value

What will the rule do after it's changed?

A default value must be defined

Additional context

@FloEdelmann
Copy link
Member

Apparently, this issue requests two improvements, both of which make sense to me:

  1. Extend vue/require-valid-default-prop to check that default values inside defineModel are valid.
  2. Extend vue/require-default-prop to check that a default value exists inside defineModel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants