And here is the culprit :smile: It would be great...
# suitescript
c
And here is the culprit 😄 It would be great if the IDE could pick this sort of thing up.
a
umm what IDE are you using, because webstorm definitely would
c
WebStorm
Nothing obvious
a
maybe cos you don't have the @param stuff?
its a minor difference but I notice it
c
What do you mean?
a
when I'm using the search module in my code, if its not defined the methods are a different color from the module name... and i notice that
c
Looks fine
a
k now I'm just confused cos mine are different... and weirdly the one that's correct is the one that LOOKS like its wrong 😄
anyway this literally happened to me once and I caught cos of WS syntax highlighting, but it seems like that was more a happy accident than something intentional 😓
c
Might be very specific to the order of what was wrong
and I got the unlucky order!
a
¯\_(ツ)_/¯
m
Eslint doesn't catch that specific case either. Only when @params is set and differs from function parameters, but not if the modules dependencies differs from function params.
m
There is an Eslint plugin for SuiteScript to enforce module naming for standard modules. This may have caught this situation. https://github.com/acdvs/eslint-plugin-suitescript
☝️ 1
👀 1
👏 2
b
s
TypeScript is the solution here. I never ever write a
define()
function - TS does that for us.
b
While I love TS, it's difficult to get everyone else onboard
m
You don't need to code in Typescript to use the type declarations. They can be imported by jsdoc
b
Yes, that's what I do