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

Fix prop validation diagnostics not working for PascalCase components in templates #2170

Merged

Conversation

triforcely
Copy link
Contributor

This PR fixes problem with 'PascalCase' component names in vue templates.

@triforcely triforcely changed the title This commit fixes prop validation for components written with PascalC… Fix prop validation diagnostics not working for PascalCase components in templates Aug 15, 2020
@triforcely
Copy link
Contributor Author

#2168

if (d) {
diagnostics.push(d);
if (n.tag) {
const kebabCaseTag = kebabCase(n.tag);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can use getSameTagInSet function?

const componetProps = getSameTagInSet(childComponentToProps, n.tag)
if (componetProps) {
  const d = generateDiagnostic(n, componetProps, document);
  if (d) {
    diagnostics.push(d);
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey. I'm new to the code base, so I didn't know this utility function exists. Thank you, I updated the code!

Copy link
Member

Choose a reason for hiding this comment

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

It's great.

@triforcely triforcely force-pushed the 2168-prop-diagnostics-broken-for-pascal-case branch from 7b70d8e to 0b9e393 Compare August 15, 2020 13:04
@triforcely triforcely requested a review from yoyo930021 August 15, 2020 13:20
@triforcely
Copy link
Contributor Author

Does anything else need to be added to this PR for it to get merged?

@yoyo930021
Copy link
Member

Does anything else need to be added to this PR for it to get merged?

You only need to wait for review by @octref.

@octref octref force-pushed the 2168-prop-diagnostics-broken-for-pascal-case branch from 0b9e393 to b7744c6 Compare August 25, 2020 08:07
Copy link
Member

@octref octref left a comment

Choose a reason for hiding this comment

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

Good work 👍
Only need to fix the Changelog so I made the change myself. Hope you don't mind.

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.

3 participants