Also, why are undefined variables default set to '...
# suitescript
c
Also, why are undefined variables default set to 'weak warning'? You can easily push a script with an undefined variable which will throw a runtime error.
s
in typescript, if it detects something as potentially undefined you get a compile time error (not just weak warning)
totally not what you asked for, but in general I question lines like the one you shared (defining a new variable just to access an existing variable)
creating aliases like that are extra mental indirection the reader needs to follow. If
soId
isn't used many places I'd leave it as
scriptContext.newRecord.id
for clarity, rather than forcing the reader to find where
soId
was defined to understand where it came from.
c
@Shawn Talbert I can't get TypeScript into this client. Their internal NetSuite team and their architects have rejected the idea twice
They don't want to maintain two languages internally and they believe the market doesn't have enough devs
s
You might try using TS on the JS - supposedly TS can work to help typing with pure JS projects
c
They also want NetSuite to support some of their scripts and NS refuse to do that with TS .
Can't even pay them to look after the TS!
s
I mean, use JS only but pass it through the TS language service and/or compiler just to get you better typechecking to the extent that it can with JS
I personally haven't used this feature but it's supposed to be something TS supports
c
@Shawn Talbert that sounds pretty cool actually.
I want to get jslint introduced at this place too - that should catch a lot of the issues I'm seeing.