mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-07 17:05:38 +02:00
Enable the unicorn/prefer-includes
linting rule
For more information refer to https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md. Fortunately this only required one change because we already use `.includes()` everywhere else. Note that that is mostly due to the `mozilla/use-includes-instead-of-indexOf` rule which we replace with this new rule now because it's more complete.
This commit is contained in:
parent
40aa593b1f
commit
ad95df2214
2 changed files with 2 additions and 2 deletions
|
@ -45,7 +45,6 @@
|
||||||
"ignore": ["display", "pdfjs", "pdfjs-lib", "pdfjs-web", "web", "fluent-bundle", "fluent-dom"],
|
"ignore": ["display", "pdfjs", "pdfjs-lib", "pdfjs-web", "web", "fluent-bundle", "fluent-dom"],
|
||||||
}],
|
}],
|
||||||
"mozilla/avoid-removeChild": "error",
|
"mozilla/avoid-removeChild": "error",
|
||||||
"mozilla/use-includes-instead-of-indexOf": "error",
|
|
||||||
"no-unsanitized/method": "error",
|
"no-unsanitized/method": "error",
|
||||||
"no-unsanitized/property": "error",
|
"no-unsanitized/property": "error",
|
||||||
"sort-exports/sort-exports": ["error", {
|
"sort-exports/sort-exports": ["error", {
|
||||||
|
@ -70,6 +69,7 @@
|
||||||
"unicorn/prefer-date-now": "error",
|
"unicorn/prefer-date-now": "error",
|
||||||
"unicorn/prefer-dom-node-append": "error",
|
"unicorn/prefer-dom-node-append": "error",
|
||||||
"unicorn/prefer-dom-node-remove": "error",
|
"unicorn/prefer-dom-node-remove": "error",
|
||||||
|
"unicorn/prefer-includes": "error",
|
||||||
"unicorn/prefer-logical-operator-over-ternary": "error",
|
"unicorn/prefer-logical-operator-over-ternary": "error",
|
||||||
"unicorn/prefer-modern-dom-apis": "error",
|
"unicorn/prefer-modern-dom-apis": "error",
|
||||||
"unicorn/prefer-modern-math-apis": "error",
|
"unicorn/prefer-modern-math-apis": "error",
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ class Driver {
|
||||||
this.output.textContent += message;
|
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
|
// Scroll to the bottom of the page
|
||||||
this.output.scrollTop = this.output.scrollHeight;
|
this.output.scrollTop = this.output.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue