Add lint rules from eslint-plugin-unicorn.

This commit is contained in:
David Anson 2020-09-06 20:34:10 -07:00
parent 0f4745efe3
commit 5ab938a6ab
11 changed files with 96 additions and 31 deletions

View file

@ -196,7 +196,8 @@
if (hashPrefix === decodedHash.substring(0, hashPrefix.length)) {
markdown.value = decodedHash.substring(hashPrefix.length);
}
} catch (ex) {
/* eslint-disable-next-line unicorn/prefer-optional-catch-binding */
} catch (error) {
// Invalid
}
}
@ -205,7 +206,8 @@
try {
/* eslint-disable-next-line no-new */
new URL(rulesMd);
} catch (ex) {
/* eslint-disable-next-line unicorn/prefer-optional-catch-binding */
} catch (error) {
markdown.value = [
"# Sorry",
"",

View file

@ -2782,10 +2782,10 @@ module.exports = {
// Close current run
var content = line.substring(emphasisIndex, matchIndex);
if (!emphasisLength) {
content = content.trimStart();
content = content.trimLeft();
}
if (!match) {
content = content.trimEnd();
content = content.trimRight();
}
var leftSpace = leftSpaceRe.test(content);
var rightSpace = rightSpaceRe.test(content);