add eslint config and missing semicolons
This commit is contained in:
parent
f6dd0b2a87
commit
6f40b25b31
40
.eslintrc.json
Normal file
40
.eslintrc.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2022": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2022,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
4
|
||||||
|
],
|
||||||
|
"linebreak-style": [
|
||||||
|
"error",
|
||||||
|
"unix"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"double"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"no-var": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"pdfjsLib": "readonly",
|
||||||
|
"channel": "readonly"
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"pdf.js",
|
||||||
|
"pdf.worker.js"
|
||||||
|
]
|
||||||
|
}
|
@ -181,7 +181,7 @@ function renderPage(pageNumber, zoom, prerender, prerenderTrigger=0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cache.length === maxCached) {
|
if (cache.length === maxCached) {
|
||||||
cache.shift()
|
cache.shift();
|
||||||
}
|
}
|
||||||
cache.push({
|
cache.push({
|
||||||
pageNumber: pageNumber,
|
pageNumber: pageNumber,
|
||||||
@ -244,7 +244,7 @@ function loadDocument() {
|
|||||||
} else if (error === pdfjsLib.PasswordResponses.INCORRECT_PASSWORD) {
|
} else if (error === pdfjsLib.PasswordResponses.INCORRECT_PASSWORD) {
|
||||||
channel.invalidPassword();
|
channel.invalidPassword();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
loadingTask.promise.then(function (newDoc) {
|
loadingTask.promise.then(function (newDoc) {
|
||||||
channel.onLoaded();
|
channel.onLoaded();
|
||||||
@ -263,4 +263,4 @@ function loadDocument() {
|
|||||||
|
|
||||||
window.onresize = () => {
|
window.onresize = () => {
|
||||||
setLayerTransform(canvas.clientWidth, canvas.clientHeight, textLayerDiv);
|
setLayerTransform(canvas.clientWidth, canvas.clientHeight, textLayerDiv);
|
||||||
}
|
};
|
||||||
|
1666
package-lock.json
generated
1666
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pdfjs-dist": "3.7.107"
|
"pdfjs-dist": "3.7.107"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^8.42.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user