-
Notifications
You must be signed in to change notification settings - Fork 103
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
new rule: prefer cap type names #81
Conversation
@DianaSuvorova: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
src/index.js
Outdated
@@ -210,6 +210,34 @@ export const rules = { | |||
); | |||
}, | |||
}, | |||
'type-names-cap': { |
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.
@DianaSuvorova this rule name could be more descriptive, especially for folks who don't know what cap
is short for. what would you think about capitalized-type-name
? (inspired by capitalized-comments from eslint)
|
||
export function typeNamesShouldBeCapitalized(context) { | ||
return { | ||
NamedType(node) { |
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.
does NamedType
get called for inline fragments? i.e., can we add a test case for
query {
someUnion {
... on someUnionMember {
someField
}
}
}
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.
Added a test.
thank you @DianaSuvorova! everything looks good, just a couple of comments to make sure the API is a little more straightforward and captures some edge cases |
@jnwng , thanks for review! I believe I addressed all the comments. Ready for re-review 🙂 |
awesome, looks good. last comment — does this actually need a schema? we're not verifying it against the schema, right? |
@jnwng , yeah I actually was thinking the same and tried the rule without providing a schema. Looks like ast parser needs it to figure out which node is |
thank you @DianaSuvorova! |
as per suggestion from #61