Use fat arrow functions const foo = () => { ... }; for callbacks
and any other function that is passed around and it's not a top level function
This commit is contained in:
@@ -89,7 +89,7 @@ for (let i = 0; i < opt.argv.length; i++) {
|
||||
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
|
||||
const body = dom.window.document.body;
|
||||
|
||||
const locator = function (elem) {
|
||||
const locator = (elem) => {
|
||||
const offset = dom.nodeLocation(elem).startOffset;
|
||||
const line = file.slice(0, offset).split("\n").length;
|
||||
return fn + ":" + line;
|
||||
|
||||
Reference in New Issue
Block a user