Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure strict mode directive in all files (#1005)
DEFRA/water-abstraction-team#115 It is currently an unwritten convention (we are [working on](DEFRA/water-abstraction-team#117) fixing that!) to add 'use strict' to the top of all our files. Why? > JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode". > [MSDN docs - Strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) When the alternate mode is named 'sloppy', would you want to use it!? The docs do provide some further explanation of what declaring strict mode means > Strict mode makes several changes to normal JavaScript semantics: > > 1. Eliminates some JavaScript silent errors by changing them to throw errors. > 2. Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode. > 3. Prohibits some syntax likely to be defined in future versions of ECMAScript. For these reasons, this change updates our ESLint rules to ensure we do this.
- Loading branch information