-
Notifications
You must be signed in to change notification settings - Fork 107
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
[naming-convention] Update property schema to accept objects. Add prefix and suffix option #201
[naming-convention] Update property schema to accept objects. Add prefix and suffix option #201
Conversation
🦋 Changeset detectedLatest commit: 1177431 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks @eddeee888 ! Sorry for the late reply. I will look into that and review in a few days :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you @eddeee888 . A few notes:
- Please make sure to add a
changeset
(runyarn changeset
and it will guide you). Please bumpminor
. - We have self-documenting rules now, so I had to make some changes to the rules definition, can you please rebase? (to run the docs generation, use
yarn generate:docs
.
…fix rule To make this rule more flexible, it needs to be able to take an object as well as format style string The config is normalised into an object before passing into the validation function. Note that we can no longer rely on the default enum check because it also tries to validate that an object is part of the enum. Therefore, the validation function needs to check the format enums now. Add suffix rule
58d063d
to
d337729
Compare
Hi @dotansimha, thank you for your feedback! I have made some changes as suggested. Please let me know if you still see problems! The only thing I'm not 100% sure about is the doc generation. I have run |
Thank you so much! It should be generated correctly, so maybe it's just something with the generation script. Can you please point me to the missing/incorrect generate doc? I will try to fix that. |
Looking at the generated doc file, there are only headers with no expected values / comment in between: Maybe it's how the doc generator works but maybe something like this communicates the config values a bit better? :)
|
Oh it should follow JSON schema structure, and I think declaring It seems like using I applied a workaround and it seems good enough for now. Thank you @eddeee888 ! |
To make this rule more flexible, it needs to be able to take an object as well as format style string. For example, we might want to check whether a field has a certain suffix. More details: #195
The config is normalized into an object before passing into the validation function.
Note that we can no longer rely on the default enum check because it also tries to validate that an object is part of the enum. Therefore, the validation function needs to check the format enums now.
Also, added a suffix option. The targeted property must have the correct suffix or it will error.
TODO