summaryrefslogtreecommitdiff
path: root/ext/js/dom
diff options
context:
space:
mode:
authorJames Maa <jmaa@berkeley.edu>2024-05-31 08:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 15:06:52 +0000
commit76ca08bd59f0e8bfa1bb20ac813f48e7ab241265 (patch)
treebdba43d9ba704885383c7f308c6fe3f574c647c5 /ext/js/dom
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/dom')
-rw-r--r--ext/js/dom/css-style-applier.js4
-rw-r--r--ext/js/dom/document-util.js2
-rw-r--r--ext/js/dom/dom-data-binder.js8
-rw-r--r--ext/js/dom/panel-element.js2
-rw-r--r--ext/js/dom/popup-menu.js6
-rw-r--r--ext/js/dom/scroll-element.js2
-rw-r--r--ext/js/dom/selector-observer.js6
-rw-r--r--ext/js/dom/simple-dom-parser.js2
-rw-r--r--ext/js/dom/text-source-generator.js2
-rw-r--r--ext/js/dom/text-source-range.js4
10 files changed, 19 insertions, 19 deletions
diff --git a/ext/js/dom/css-style-applier.js b/ext/js/dom/css-style-applier.js
index ba49d6aa..b78ad4a5 100644
--- a/ext/js/dom/css-style-applier.js
+++ b/ext/js/dom/css-style-applier.js
@@ -63,7 +63,7 @@ export class CssStyleApplier {
}
styleData.push({
selectors: selectors2,
- styles: styles2
+ styles: styles2,
});
}
}
@@ -112,7 +112,7 @@ export class CssStyleApplier {
cache: 'default',
credentials: 'omit',
redirect: 'follow',
- referrerPolicy: 'no-referrer'
+ referrerPolicy: 'no-referrer',
});
if (!response.ok) {
throw new Error(`Failed to fetch ${url}: ${response.status}`);
diff --git a/ext/js/dom/document-util.js b/ext/js/dom/document-util.js
index fc9a7f12..f8dba878 100644
--- a/ext/js/dom/document-util.js
+++ b/ext/js/dom/document-util.js
@@ -199,7 +199,7 @@ export function addFullscreenChangeEventListener(onFullscreenChanged, eventListe
'fullscreenchange',
'MSFullscreenChange',
'mozfullscreenchange',
- 'webkitfullscreenchange'
+ 'webkitfullscreenchange',
];
for (const eventName of fullscreenEventNames) {
if (eventListenerCollection === null) {
diff --git a/ext/js/dom/dom-data-binder.js b/ext/js/dom/dom-data-binder.js
index 14b3b2cd..586e5869 100644
--- a/ext/js/dom/dom-data-binder.js
+++ b/ext/js/dom/dom-data-binder.js
@@ -56,7 +56,7 @@ export class DOMDataBinder {
onAdded: this._createObserver.bind(this),
onRemoved: this._removeObserver.bind(this),
onChildrenUpdated: this._onObserverChildrenUpdated.bind(this),
- isStale: this._isObserverStale.bind(this)
+ isStale: this._isObserverStale.bind(this),
});
}
@@ -105,7 +105,7 @@ export class DOMDataBinder {
const args = targets.map(([observer]) => ({
element: observer.element,
- metadata: observer.metadata
+ metadata: observer.metadata,
}));
const responses = await this._getValues(args);
this._applyValues(targets, responses, true);
@@ -123,7 +123,7 @@ export class DOMDataBinder {
args.push({
element: observer.element,
metadata: observer.metadata,
- value: task.data.value
+ value: task.data.value,
});
targets.push([observer, task]);
}
@@ -181,7 +181,7 @@ export class DOMDataBinder {
value: null,
hasValue: false,
onChange: null,
- metadata
+ metadata,
};
observer.onChange = this._onElementChange.bind(this, observer);
diff --git a/ext/js/dom/panel-element.js b/ext/js/dom/panel-element.js
index 97b05599..f8c93dda 100644
--- a/ext/js/dom/panel-element.js
+++ b/ext/js/dom/panel-element.js
@@ -96,7 +96,7 @@ export class PanelElement extends EventDispatcher {
this._mutationObserver.observe(this._node, {
attributes: true,
attributeFilter: ['hidden'],
- attributeOldValue: true
+ attributeOldValue: true,
});
}
super.on(eventName, callback);
diff --git a/ext/js/dom/popup-menu.js b/ext/js/dom/popup-menu.js
index 28bcc309..778f9196 100644
--- a/ext/js/dom/popup-menu.js
+++ b/ext/js/dom/popup-menu.js
@@ -89,7 +89,7 @@ export class PopupMenu extends EventDispatcher {
this._sourceElement.dispatchEvent(new CustomEvent('menuOpen', {
bubbles: false,
cancelable: false,
- detail
+ detail,
}));
}
@@ -257,7 +257,7 @@ export class PopupMenu extends EventDispatcher {
altKey,
ctrlKey,
metaKey,
- shiftKey
+ shiftKey,
};
const result = this._sourceElement.dispatchEvent(new CustomEvent('menuClose', {bubbles: false, cancelable, detail}));
if (cancelable && !result) { return false; }
@@ -280,5 +280,5 @@ Object.defineProperty(PopupMenu, 'openMenus', {
configurable: false,
enumerable: true,
writable: false,
- value: new Set()
+ value: new Set(),
});
diff --git a/ext/js/dom/scroll-element.js b/ext/js/dom/scroll-element.js
index 7cd00f01..e0028d7a 100644
--- a/ext/js/dom/scroll-element.js
+++ b/ext/js/dom/scroll-element.js
@@ -121,7 +121,7 @@ export class ScrollElement {
const t = this._easeInOutCubic((time - this._animationStartTime) / (this._animationEndTime - this._animationStartTime));
this._scroll(
this._lerp(this._animationStartX, this._animationEndX, t),
- this._lerp(this._animationStartY, this._animationEndY, t)
+ this._lerp(this._animationStartY, this._animationEndY, t),
);
this._animationRequestId = window.requestAnimationFrame(this._requestAnimationFrameCallback);
diff --git a/ext/js/dom/selector-observer.js b/ext/js/dom/selector-observer.js
index 032805e8..b46feaca 100644
--- a/ext/js/dom/selector-observer.js
+++ b/ext/js/dom/selector-observer.js
@@ -31,7 +31,7 @@ export class SelectorObserver {
onAdded = null,
onRemoved = null,
onChildrenUpdated = null,
- isStale = null
+ isStale = null,
}) {
/** @type {string} */
this._selector = selector;
@@ -84,7 +84,7 @@ export class SelectorObserver {
this._mutationObserver.observe(element, {
attributes: !!attributes,
childList: true,
- subtree: true
+ subtree: true,
});
const {parentNode} = element;
@@ -92,7 +92,7 @@ export class SelectorObserver {
type: 'childList',
target: parentNode !== null ? parentNode : element,
addedNodes: [element],
- removedNodes: []
+ removedNodes: [],
}]);
}
diff --git a/ext/js/dom/simple-dom-parser.js b/ext/js/dom/simple-dom-parser.js
index adc009bf..bd3f1616 100644
--- a/ext/js/dom/simple-dom-parser.js
+++ b/ext/js/dom/simple-dom-parser.js
@@ -33,7 +33,7 @@ export class SimpleDOMParser {
this._treeAdapter = this._parse5Lib.defaultTreeAdapter;
/** @type {import('simple-dom-parser').Parse5Document} */
this._document = this._parse5Lib.parse(content, {
- treeAdapter: this._treeAdapter
+ treeAdapter: this._treeAdapter,
});
/** @type {RegExp} */
this._patternHtmlWhitespace = /[\t\r\n\f ]+/g;
diff --git a/ext/js/dom/text-source-generator.js b/ext/js/dom/text-source-generator.js
index c4711411..279c4725 100644
--- a/ext/js/dom/text-source-generator.js
+++ b/ext/js/dom/text-source-generator.js
@@ -174,7 +174,7 @@ export class TextSourceGenerator {
// Result
return {
text: text.substring(cursorStart, cursorEnd),
- offset: startLength - cursorStart
+ offset: startLength - cursorStart,
};
}
diff --git a/ext/js/dom/text-source-range.js b/ext/js/dom/text-source-range.js
index 68ba208a..4a6f5e2f 100644
--- a/ext/js/dom/text-source-range.js
+++ b/ext/js/dom/text-source-range.js
@@ -108,7 +108,7 @@ export class TextSourceRange {
this._imposterSourceElement,
this._cachedRects,
this._cachedSourceRect,
- this._disallowExpandSelection
+ this._disallowExpandSelection,
);
}
@@ -307,7 +307,7 @@ export class TextSourceRange {
return offsetDOMRects(
this._cachedRects,
sourceRect.left - this._cachedSourceRect.left,
- sourceRect.top - this._cachedSourceRect.top
+ sourceRect.top - this._cachedSourceRect.top,
);
}
}