Skip to content
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

[APIDocs] const + arrow functions result in uncommented function parameters #98744

Closed
afharo opened this issue Apr 29, 2021 · 3 comments · Fixed by #100823
Closed

[APIDocs] const + arrow functions result in uncommented function parameters #98744

afharo opened this issue Apr 29, 2021 · 3 comments · Fixed by #100823
Assignees
Labels
APIDocs Team:Operations Team label for Operations Team

Comments

@afharo
Copy link
Member

afharo commented Apr 29, 2021

In #98656 we noticed that functions that are defined as const myVar = (params) => {...} are reported as myVar.$1 is missing comments.

Functions that do not require any params (const myVar = () => {...}) don't show such errors. We might need to fix our scripts/build_api_docs piece of logic to cover this use case.

Why using const + arrow function vs. function? Because it helps with the typing of the function. An example is React.FC definitions like the one below:

export const TrackApplicationView: FC<TrackApplicationViewProps> = (props) => {
return (
<ApplicationUsageContext.Consumer>
{(value) => {
const propsWithTracker = { ...props, applicationUsageTracker: value };
return <TrackApplicationViewComponent {...propsWithTracker} />;
}}
</ApplicationUsageContext.Consumer>
);
};

@afharo afharo added the APIDocs label Apr 29, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Apr 29, 2021
@lukeelmers lukeelmers added Team:Operations Team label for Operations Team triage_needed labels May 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 26, 2021
@spalger
Copy link
Contributor

spalger commented May 26, 2021

cc @stacey-gammon

@stacey-gammon stacey-gammon self-assigned this May 27, 2021
@stacey-gammon
Copy link
Contributor

Simple fix, I'll throw up a PR soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIDocs Team:Operations Team label for Operations Team
Projects
None yet
5 participants