functions-samples
functions-samples copied to clipboard
'use strict'; declared in firebase function samples
Posting this here as per @codingdoug's suggestion.
https://groups.google.com/forum/#!topic/firebase-talk/xCSiEP82kf0
I've noticed that 'use strict';
is declared at the top of a lot of files in https://github.com/firebase/functions-samples but yet, when I watch different firebase videos on youtube from the firebase team, they don't use it there. I've googled what it actually means, and it makes sense that I would enable this so called "strict mode" on my production grade project, but I was wondering if anyone could shed any light on why it's not included in the videos/every sample. Maybe I'm just being anal. Maybe it's just me being a Java dev for so long that I don't understand what it is (new to this server/nodejs world of things. I also get that this probably has nothing to do with firebase as well.
It sounds like @codingdoug was saying that TS files don't need use strict
; for strict mode.
In the sample TS function on the github page it does include this line. Are you saying that the sample TS file is incorrect?
https://github.com/firebase/functions-samples/blob/master/typescript-getting-started/functions/src/index.ts
Apologies if this is a dumb question and that this is a bit all over the place.