-
Notifications
You must be signed in to change notification settings - Fork 0
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
CON-1959: add default-value rule #2
Conversation
c2edbc5
to
e2ef35d
Compare
a171f70
to
6829251
Compare
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.
Super nice 🚀
twoArguments: 'Translate function should have two arguments', | ||
optionsObject: 'Translate function options should be an object', | ||
defaultValuePresence: | ||
'Translate function defaultValue must a string property on the second argument', |
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.
typo nit: must a string
|
||
if (prop?.value.type === 'Literal' && typeof prop.value.value === 'string') { | ||
const variableNames = prop.value.value | ||
.match(/{{[ a-zA-Z0-9]+}}/g) |
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.
Did we need the white space after the first [
?
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.
yes, to ensure we also match e.g. {{ long }}
, not just {{long}}
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.
Awesome!
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Note: This PR depends on #1.
Motivation
Adding an initial rule for enforcing
defaultValue
behavior.