Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ace editor javascript-worker force 'use strict'

I use the syntax checking in ace editor (javascript-worker). I need to use the syntax checking 'use strict' mode, but without a declaration "use strict" in the body of the code, How i can to configure that?

like image 480
Кондаков Артем Avatar asked Mar 25 '26 14:03

Кондаков Артем


1 Answers

(function configureAceWorker() {
    const worker = editor.session.$worker;
    if (!worker) {
        setTimeout(configureAceWorker, 500);
    } else {
        worker.call("changeOptions", [{
            // https://jshint.com/docs/options
            strict: "implied", // lint the code as if there is the "use strict"; directive
        }]);
    }
})();
like image 173
fredoverflow Avatar answered Mar 27 '26 03:03

fredoverflow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!