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

Potential bug with optional function argument #396

Closed
Zamiell opened this issue Feb 8, 2023 · 3 comments
Closed

Potential bug with optional function argument #396

Zamiell opened this issue Feb 8, 2023 · 3 comments
Labels
next Fix available in the '@next' release

Comments

@Zamiell
Copy link
Contributor

Zamiell commented Feb 8, 2023

Hello,
I think I found a bug in the plugin.

Here's the source code for a function called "spawnCustomGridEntity":
https://github.com/IsaacScript/isaacscript/blob/4d4cfd0/packages/isaacscript-common/src/classes/features/callbackLogic/CustomGridEntities.ts#L229-L237

We can see that it has, in order:

  • 2 mandatory arguments
  • 3 optional arguments
  • 2 more optional arguments, with a default value specified

TypeDoc makes the output of the function look like this:
https://isaacscript.github.io/isaacscript-common/features/CustomGridEntities#parameters

We can see that the final two arguments do not have the question mark like the other optional arguments do, which seems to be a bug.

@tgreyuk
Copy link
Member

tgreyuk commented Feb 8, 2023

Interesting - we can easily flag default params as optional (which technically they are), but what if the first argument has a default value.? In this case you would have to pass in null or undefined to the first argument.

@Zamiell
Copy link
Contributor Author

Zamiell commented Feb 8, 2023

That's true. So perhaps the plugin should only mark arguments as being "optional" if they are not followed by a mandatory argument.

@tgreyuk tgreyuk added the next Fix available in the '@next' release label Apr 18, 2023
@tgreyuk
Copy link
Member

tgreyuk commented May 3, 2024

typedoc-plugin-markdown@4.0.0

@tgreyuk tgreyuk closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Fix available in the '@next' release
Projects
None yet
Development

No branches or pull requests

2 participants