I'm wondering who likes a good JSdoc entry? I see...
# suitescript
p
I'm wondering who likes a good JSdoc entry? I see alot of people skipping important details from time to time, what is your vision in this ? /** * @NApiVersion 2.1 * @NScriptType MapReduceScript * @NModuleScope SameAccount * @author @Philip Denys * @description this script processes the incoming sales order where the customer details are noted, this data will go into a flow, eventually creating a customer either company or individual... */
n
Love to see it, hate to do it myself
💯 1
😅 1
But that's more of a me problem
🤣 1
n
Yeah I put version / date in there as well though I'm not sure that's actually a good thing.
What really annoys me is when people put the name of the js file in the JSDOCS, I mean.. why??? 🤷🏻‍♂️
🫣 1
n
Yeah that doesn’t make a ton of sense. Edit: Eric made it make sense below We do the script record name in ours which makes a little more sense to me.
n
I follow a similar version of this.
d
Love seeing it myself also. We do JSDocs at the file level and function level. If using VSCode, Copilot does a pretty decent job scaffolding a lot of it for you (with some minor edits needed after).
👌 1
e
Yep, I consistently use JSDocs for file and function headers. File templates in WebStorm for all the script types make it so I get all the required tags and code completion wiring "for free", which means I just get to write the meaningful stuff
n
For those of us on typescript too it becomes invaluable for importing functions from other scripts.
💯 1
e
Oh yes; I don't use TypeScript, but I do use JSDoc's
@typedef
tag to define my custom data structs
1
p
the main purpose for adding a description to the jsdoc is for my 'future-self' that visits the code after 1 or more years 😅 + when I deploy scripts I copy/paste this into the 'script/deployment record' instead of getting empty help and/or description fields
👍 1
e
I don't mind the filename in the comments. In WebStorm, at least, searching files and searching contents are two completely different searches, so having the filename in the file contents makes it faster to jump to a specific file using the same search as you use for code.
👌 1
n
Oh very good point
e
I've worked with a couple teams that did this. I turned my nose up at it at first, but once I discovered ^ this, I was quite happy to have it 😄
😂 1
p
@erictgrubaugh talking about webstorm, can it create scrip/deployment records?
e
It has an SDF plugin which can create them, yes
p
yeah in vscode it doesn't seem to have that function
😮 1
n
I think if you use the sdf cli you can do it in Vs code.
🤔 1
p
nope
n
~Is it not “create suitescript file” I haven’t tried it I am actually just curious.~
Or file:create
I didn’t read your initial question properly ignore me
👌 1
p
its ok 😛
n
This in WebStorm is what you were asking about. (which I confess until today I did not realise was an option 😄 )
😄 2