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

Function parsing #107

Closed
CU-Sam opened this issue Dec 5, 2019 · 4 comments
Closed

Function parsing #107

CU-Sam opened this issue Dec 5, 2019 · 4 comments

Comments

@CU-Sam
Copy link

CU-Sam commented Dec 5, 2019

Hi and thank you for your job !

The basic parsing of callback functions as you describe it is :
function(type1, type2, ...): returnType
This format does not allow naming of different args. Could you support this type of format :
function(var1:type1, var2:type2, ...): returnType
or the arrow function format
(var1:type1, var2:type2, ...) => returnType

As your project is used within ESLint this could be very usefull.
Thanks

@brettz9
Copy link
Contributor

brettz9 commented Dec 5, 2019

I think this should be merged into #50 .

@CU-Sam
Copy link
Author

CU-Sam commented Dec 5, 2019

The typescript notation of arrow function could do the trick. I tried it on your live demo and it works. Maybe ESLint does not contains the last version of your project. I'll check that in my project.
Thanks for the answer.

@CU-Sam CU-Sam closed this as completed Dec 5, 2019
@brettz9
Copy link
Contributor

brettz9 commented Dec 5, 2019

To my knowledge ESLint was never using jsdoctypeparser. They had their own parser doctrine which they have since deprecated along with their jsdoc rules in favor of eslint-plugin-jsdoc--which does use jsdoctypeparser.

@CU-Sam
Copy link
Author

CU-Sam commented Dec 5, 2019

Yes you're right this is the plugin eslint-plugin-jsdoc that use it. I checked on my project and it enclose the last version of jsdoctypeparser (5.1.1). To my surprise, the arrow function format is active in my project and works fine. I didn't realise it because I wrongly use this format (I omitted the types behind this arguments).

** confused **

Sorry for this PEBKAC !! :D
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants