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

feat(no-unused-properties): mark $props.<prop> as used #2345

Merged
merged 2 commits into from
Dec 28, 2023
Merged

feat(no-unused-properties): mark $props.<prop> as used #2345

merged 2 commits into from
Dec 28, 2023

Conversation

levchak0910
Copy link
Contributor

fixes #2344

@FloEdelmann could you please mark my issue as open again?

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the contribution! 🙂

@FloEdelmann FloEdelmann requested a review from ota-meshi December 4, 2023 20:23
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Sorry for the late review. The added source code looks good, but doesn't this PR add support for using this.$props in component methods?

@levchak0910
Copy link
Contributor Author

levchak0910 commented Dec 27, 2023

Hi @ota-meshi, thanks for the review

Initially, I didn't want to support it in <script> because

  1. I was afraid of the implementation's complexity
  2. On my personal opinion using this.$props.<prop> should be discouraged

but

  • with the understanding that my PR was just a half-solution
  • after I searched a bit on GitHub, I saw that many people use this.$props.<prop> in their code
  • with some more courage and time

I jumped into the code again and luckily it was not as hard as I expected )

So now the rule supports $props.<prop> in both template and script

@levchak0910 levchak0910 changed the title feat(no-unused-properties): mark $props.<prop> as used in template feat(no-unused-properties): mark $props.<prop> as used Dec 27, 2023
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@ota-meshi ota-meshi merged commit 63a17bd into vuejs:master Dec 28, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[no-unused-properties] can't recognize $props.xxx used
3 participants