-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Annotate all internal functions with '@internal' #2183
Comments
Working on it. Removed assignment by mistake |
Spent the entire day on this and doing this by hand is really tricky and prone to errors. How to resolve this problemMy approach for this would be to:
There is the interest of having this kind of check-in TypeScript community ( AdvantageAdvantage of this approach is that:
What it means that it will require much more work initially, but it will be much better for tracking API changes in the future. I have seen some babel tools that can help here, but if you guys know any other tools that can help feel free to post it here. |
@wtrocki |
Yes. I meant ESLint. For the moment I just have node script that need to print out method names so I can find them and manually add comment |
Got some progress on this but still not ready for PR. I will be off next week so hopefuly I will manage to create PR next next week |
@craicoverflow Thanks a lot for #2205 I merged it in but I will keep this issue open to tracking the development of ESLint rule. |
@IvanGoncharov , related to the development of ESLint Rule, I was thinking we can do it as 2 step process:-
We can execute the first step through babel plugin to get list of all the exported variables from the index in current subdirectory of Graphql... This might cause a problem when 2 different files export the function/class having same name... We can tackle this problem in 2 ways:-
Can I take up this issue, if yes, which approach should I follow? |
I created a babel-plugin for the same since we are using only ExportNamedDeclarations, this plugin only extracts the list of exported variables with ExportNamedDeclarations... This means that code like export let name1, name2=5, nameN; is not supported, and name1, name2, nameN will not be output of the plugin... However this can be modified if required... You can check the console to get the array of exported names/functions... |
Even though some functions are expored from
src/**/*.js
files they are private.The only function exported by
src/index.js
andsrc/*/index.js
are considered to be part of the public API. Please see:https://github.com/graphql/graphql-js/blob/master/src/README.md
It would be great to have all private API marked as such, e.g.:
graphql-js/tstypes/validation/validate.d.ts
Lines 32 to 33 in 6f341a3
Also, it would be great to find all public APIs without JS doc comments.
The text was updated successfully, but these errors were encountered: