<commit_before>(function (mod) {
    if (typeof exports == "object" && typeof module == "object") // CommonJS
        mod(require("../../lib/codemirror"));
    else if (typeof define == "function" && define.amd) // AMD
        define(["../../lib/codemirror"], mod);
    else // Plain browser env
        mod(CodeMirror);
})(function (CodeMirror) {
    "use strict";

    Sink.registerFunctionOnReceive(function (newProduct) {
        if (newProduct.product === 'errors') {
            $('.CodeMirror')[0].CodeMirror.performLint();
        }
    });

    CodeMirror.registerHelper("lint", "monto", function (text) {
        var list = [];
        var product = Sink.getErrors();
        var contents = JSON.parse(product.contents !== undefined ? product.contents : '[]');
        contents.forEach(function (content) {
            var position = Source.convertMontoToCMPosWithLength({offset: content.offset, length: content.length});
            list.push({
                message: content.description,
                severity: 'error',
                from: position.from,
                to: position.to
            });
        });
//      {message, severity, form, to}
        return list;
    });

});<commit_msg>remove linting when current product language differs from version one<commit_after>(function (mod) {
    if (typeof exports == "object" && typeof module == "object") // CommonJS
        mod(require("../../lib/codemirror"));
    else if (typeof define == "function" && define.amd) // AMD
        define(["../../lib/codemirror"], mod);
    else // Plain browser env
        mod(CodeMirror);
})(function (CodeMirror) {
    "use strict";

    Sink.registerFunctionOnReceive(function (newProduct) {
        if (newProduct.product === 'errors') {
            $('.CodeMirror')[0].CodeMirror.performLint();
        }
    });

    CodeMirror.registerHelper("lint", "monto", function (text) {
        var list = [];
        var product = Sink.getErrors();
        var version = Source.getMessage();
        if (product.language !== version.language) {
            return [];
        }
        var contents = JSON.parse(product.contents !== undefined ? product.contents : '[]');
        contents.forEach(function (content) {
            var position = Source.convertMontoToCMPosWithLength({offset: content.offset, length: content.length});
            list.push({
                message: content.description,
                severity: 'error',
                from: position.from,
                to: position.to
            });
        });
//      {message, severity, form, to}
        return list;
    });

});
{'fraction_non_alphanumeric': 0.15463917525773196, 'fraction_numerical': 0.0007636502481863307, 'mean_word_length': 2.1680773881499396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4502323', 'n_tokens_mistral': 720, 'n_tokens_neox': 689, 'n_words': 160}