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: Add lint rule for Field component #108

Merged

Conversation

Harsh-Modi278
Copy link
Contributor

Add lint rules for Field component.

  • Make sure that Field component has following props:
    • label
    • validationMessage or hint

Notes:


if (
hasNonEmptyProp(node.attributes, "label", true) &&
(hasNonEmptyProp(node.attributes, "validationMessage", true) || hasNonEmptyProp(node.attributes, "hint", true))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the rule looking for the label is universal to all components. The check for validationMessage or hint is not. Maybe you could also add if the Field has certain child components, then the check is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we also have a rule for no empty components, so that will work in this case. What do you say?

Copy link
Collaborator

@aubreyquinn aubreyquinn left a comment

Choose a reason for hiding this comment

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

comment

@aubreyquinn aubreyquinn merged commit 00bd24a into microsoft:main Sep 20, 2024
4 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.

2 participants