Skip to content

Commit

Permalink
Merge pull request #18571 from timvandermeij/linting
Browse files Browse the repository at this point in the history
Enable the `unicorn/{prefer-includes,throw-new-error}` linting rules
  • Loading branch information
timvandermeij committed Aug 8, 2024
2 parents 40aa593 + 318433b commit cd3d188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"ignore": ["display", "pdfjs", "pdfjs-lib", "pdfjs-web", "web", "fluent-bundle", "fluent-dom"],
}],
"mozilla/avoid-removeChild": "error",
"mozilla/use-includes-instead-of-indexOf": "error",
"no-unsanitized/method": "error",
"no-unsanitized/property": "error",
"sort-exports/sort-exports": ["error", {
Expand All @@ -70,6 +69,7 @@
"unicorn/prefer-date-now": "error",
"unicorn/prefer-dom-node-append": "error",
"unicorn/prefer-dom-node-remove": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-logical-operator-over-ternary": "error",
"unicorn/prefer-modern-dom-apis": "error",
"unicorn/prefer-modern-math-apis": "error",
Expand All @@ -79,6 +79,7 @@
"unicorn/prefer-string-replace-all": "error",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/prefer-ternary": ["error", "only-single-line"],
"unicorn/throw-new-error": "error",

// Possible errors
"for-direction": "error",
Expand Down
2 changes: 1 addition & 1 deletion test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ class Driver {
this.output.textContent += message;
}

if (message.lastIndexOf("\n") >= 0 && !this.disableScrolling.checked) {
if (message.includes("\n") && !this.disableScrolling.checked) {
// Scroll to the bottom of the page
this.output.scrollTop = this.output.scrollHeight;
}
Expand Down

0 comments on commit cd3d188

Please sign in to comment.