Mark S. Miller (2014-01-24T20:22:48.000Z)
domenic at domenicdenicola.com (2014-01-31T21:18:17.707Z)
Assuming the current system for a moment, and discussing only conventions: It is true that a "use strict" at the top of every *.js file does have the virtue of making it clear, both to tools and humans, that the remainder is strict code, even in one doesn't know if the file is to be loaded as a module or a script. Historically, we've recommended against a bare "use strict" at the top of script files http://wiki.ecmascript.org/doku.php?id=conventions:avoid_strictness_contagion, in order to avoid the concatenation hazard. Instead, we recommend that script files have an outer strict IIFE. This still seems sensible when there's genuine ambiguity about whether it is a module or a script. OTOH, if the author knows it is a module and simply wants to disambiguate to tools that it is strict, then the author knows there's no concatenation hazard and a bare "use strict" at the top would be fine. And, of course, if there are any export or import statements in there, then it cannot be a script, and it cannot be contained in an IIFE. Btw, the conventional name for the opposite of strict is "sloppy" rather than "loose".