How to enable strict mode for my entire package, but not for dependency?

I used to write "use strict";as the first line in my JavaScript files to enable strict mode. Now I do not want to add this as boilerplate code to over 200 JavaScript files of my current NodeJs package.

Is it possible to force strict mode for all files in my package without forcing it for the dependencies of my package?

EDIT: This has been noted twice as a duplicate of the general question of how to enforce strict mode in node . This is not a duplicate, since this question is much more restrictive: do not force, add lines to each file and do not force, without forcing it for dependencies.

+4
source share
1 answer

Given that you noted , I assume you are using ES6 modules (and if not, you really should). Then you have nothing to do - the modules are already implicitly building the mode code!

0
source

Source: https://habr.com/ru/post/1667482/


All Articles