Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 754 Bytes

empty-script.md

File metadata and controls

23 lines (17 loc) · 754 Bytes

Warn if executeScript() or executeAsyncScript() are called with missing or empty script

This is a simple rule that would warn if executeScript()/executeAsyncScript() calls are missing arguments, or if the first argument is an empty string.

Rule details

👎 Any use of the following patterns are considered warnings:

browser.executeScript();
browser.executeAsyncScript();
browser.executeScript("");
browser.executeAsyncScript('');

👍 The following patterns are not errors:

browser.executeScript("var a = 1;");
browser.executeAsyncScript("var a = 1;");
var tag = browser.executeScript('return arguments[0].tagName', el);
browser.executeAsyncScript('var callback = arguments[arguments.length - 1];');