tsling raise an error:
Line 1: 'use strict' is unnecessary inside of modules (strict)
this is my code
"use strict";
function Foo() {}
Foo.prototype.sayHello= function () {
console.log("hello!");
}
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = {
Foo: Foo
};
}
how fix this error?
Side note
my code is used both module
and vanilla javascript. I want use "strict mode"
only for vanilla javascript.
maybe i can use
if (typeof module !== 'undefined') {
"use strict";
}
for enabling strict mode
only for vanilla javascript?