mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Enable the unicorn/prefer-negative-index
ESLint plugin rule
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
This commit is contained in:
parent
b119cde030
commit
96e34fbb7d
5 changed files with 7 additions and 6 deletions
|
@ -471,12 +471,12 @@ function validateCSSFont(cssFontInfo) {
|
|||
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/CSS/string.
|
||||
if (/^".*"$/.test(fontFamily)) {
|
||||
if (/[^\\]"/.test(fontFamily.slice(1, fontFamily.length - 1))) {
|
||||
if (/[^\\]"/.test(fontFamily.slice(1, -1))) {
|
||||
warn(`XFA - FontFamily contains some unescaped ": ${fontFamily}.`);
|
||||
return false;
|
||||
}
|
||||
} else if (/^'.*'$/.test(fontFamily)) {
|
||||
if (/[^\\]'/.test(fontFamily.slice(1, fontFamily.length - 1))) {
|
||||
if (/[^\\]'/.test(fontFamily.slice(1, -1))) {
|
||||
warn(`XFA - FontFamily contains some unescaped ': ${fontFamily}.`);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue