jsr-io / jsr

The open-source package registry for modern JavaScript and TypeScript
https://jsr.io
MIT License
2.18k stars 99 forks source link

Arrow function should be `variable`? #569

Open yusukebe opened 1 month ago

yusukebe commented 1 month ago

Hi! Thank you for the great project. This issue is regarding the "Docs" feature of the JSR website.

Our project prefers to use the arrow function style to define functions rather than using the function keyword:

// OK
export const getCookie = () => { return /.../ }

// NO
export function getCookie(){ return /.../ }

But the generated docs for this function in the JSR website will label it as variable:

An example: https://jsr.io/@hono/hono@4.4.0-rc.1/doc/cookie/~/getCookie

CleanShot 2024-05-26 at 22 39 44@2x

I know that if we use the function keyword, it will recognize that as a function. But we don't want to rewrite the arrow functions to the function declaration style. Do we have any way to make it function instead of variable? Or do you have a plan to update? Thanks!

crowlKats commented 1 month ago

hey, yes, we are planning to treat variables like that as function

yusukebe commented 1 month ago

Great! I'm waiting for it.