Sha256: f2b5cd8da5acebad54c10edef13e27dc3b7295d9cd1b366b42a4a331ef1c018e

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

/**
 * @fileoverview Rule to flag when using javascript: urls
 * @author Ilya Volodin
 */
/* jshint scripturl: true */
/* eslint no-script-url: 0 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = function(context) {

    return {

        "Literal": function(node) {

            var value;

            if (node.value && typeof node.value === "string") {
                value = node.value.toLowerCase();

                if (value.indexOf("javascript:") === 0) {
                    context.report(node, "Script URL is a form of eval.");
                }
            }
        }
    };

};

module.exports.schema = [];

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eslint_node_modules-1.6.0.1 vendor/node_modules/eslint/lib/rules/no-script-url.js
eslint_node_modules-1.6.0 vendor/node_modules/eslint/lib/rules/no-script-url.js