-
Notifications
You must be signed in to change notification settings - Fork 62
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
Is there any plan to add initialisms rule? #283
Comments
👋 @dengliu, I could see this being useful for rules like I think we'd want to let people configure their initialisms and then we can use that configuration within the rule when applicable. Given that there are multiple rules that might need this information (e.g. Here's an example rule that leverages the global configuration: graphql-schema-linter/src/rules/fields_have_descriptions.js Lines 4 to 12 in c2876f3
If you'd like to help contribute this feature, I'd be happy to discuss ideas here and 👀 review your implementation. |
thanks for the quick @cjoudrey I agree to give the flexibility for users to define their own list of initialisms. However, I think as a first step, we can start with some common initialisms defined in lib/config.js , just follow the golint example below: WDYT? |
Yeah, that's definitely a second option. I'm not too sure about that approach as this might force people to change their schema and changing the casing of a type / field might be considered a breaking change for some implementations. e.g. If we decide |
agree. Ideally would like to introduce the
|
Oh, that's an interesting idea too. 🤔 I was just looking at the rules I mentioned above, and they seem to be pretty loose with the definition of camel case: graphql-schema-linter/test/rules/fields_are_camel_cased.js Lines 16 to 17 in c2876f3
So perhaps we could do this as a new rule that checks initialisms everywhere. Nitpick about your configuration example, I think we could probably go with an array of strings, unless the boolean value has meaning. |
Oh, the reason to use map instead of list is to have the the developer to have options to know what are the common initialism available to config instead having them to spent too much time to compile this list. |
Is there any plan to add initialisms rule?
https://github.com/golang/go/wiki/CodeReviewComments#initialisms
The text was updated successfully, but these errors were encountered: