Disallow javascript:
urls
Using javascript:
URLs is considered by some as a form of eval
. Code passed in javascript:
URLs has to be parsed and evaluated by the browser in the same way that eval
is processed.
Examples of incorrect code for this rule:
/*eslint no-script-url: "error"*/
location.href = "javascript:void(0)";
location.href = `javascript:void(0)`;
scripturl
rule of JSHint.This rule was introduced in ESLint v0.0.9.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/no-script-url