refactor: eliminate eslint errors (#920)

* refactor: eliminate eslint errors as many as I can

* refactor: fix more eslint errors in the record module

* LINT: fix @typescript-eslint/unbound-method

* LINT: fix all eslint errors in source code

* LINT: fix as many eslint warnings as possible

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent a4360af11a
commit 79dc0fb46c
44 changed files with 524 additions and 374 deletions

View File

@@ -134,7 +134,7 @@ function buildNode(
n.publicId,
n.systemId,
);
case NodeType.Element:
case NodeType.Element: {
const tagName = getTagName(n);
let node: Element;
if (n.isSVG) {
@@ -143,7 +143,7 @@ function buildNode(
node = doc.createElement(tagName);
}
for (const name in n.attributes) {
if (!n.attributes.hasOwnProperty(name)) {
if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {
continue;
}
let value = n.attributes[name];
@@ -290,6 +290,7 @@ function buildNode(
}
}
return node;
}
case NodeType.Text:
return doc.createTextNode(
n.isStyle && hackCss
@@ -417,7 +418,12 @@ function handleScroll(node: Node, mirror: Mirror) {
}
const el = node as HTMLElement;
for (const name in n.attributes) {
if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {
if (
!(
Object.prototype.hasOwnProperty.call(n.attributes, name) &&
name.startsWith('rr_')
)
) {
continue;
}
const value = n.attributes[name];