summaryrefslogtreecommitdiff
path: root/source/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'source/helpers')
-rw-r--r--source/helpers/add-after-branch-selector.tsx2
-rw-r--r--source/helpers/attach-element.ts2
-rw-r--r--source/helpers/bisect.tsx4
-rw-r--r--source/helpers/calculate-css-calc-string.test.ts2
-rw-r--r--source/helpers/calculate-css-calc-string.ts2
-rw-r--r--source/helpers/caller-id.test.ts2
-rw-r--r--source/helpers/caller-id.ts2
-rw-r--r--source/helpers/clean-commit-message.test.ts2
-rw-r--r--source/helpers/click-all.ts2
-rw-r--r--source/helpers/fetch-dom.ts4
-rw-r--r--source/helpers/get-items-between.test.ts2
-rw-r--r--source/helpers/hotfix.tsx4
-rw-r--r--source/helpers/is-low-quality-comment.test.ts2
-rw-r--r--source/helpers/loose-parse-int.test.ts2
-rw-r--r--source/helpers/on-element-replacement.ts2
-rw-r--r--source/helpers/pluralize.test.ts2
-rw-r--r--source/helpers/pr-commit-cleaner.test.ts2
-rw-r--r--source/helpers/select-has.test.ts2
-rw-r--r--source/helpers/select-has.ts2
-rw-r--r--source/helpers/selector-observer.tsx8
-rw-r--r--source/helpers/show-whitespace-on-line.test.ts2
-rw-r--r--source/helpers/show-whitespace-on-line.tsx2
-rw-r--r--source/helpers/types.d.ts2
23 files changed, 29 insertions, 29 deletions
diff --git a/source/helpers/add-after-branch-selector.tsx b/source/helpers/add-after-branch-selector.tsx
index e2e1c0fb..5ed5d35a 100644
--- a/source/helpers/add-after-branch-selector.tsx
+++ b/source/helpers/add-after-branch-selector.tsx
@@ -2,7 +2,7 @@ import React from 'dom-chef';
import select from 'select-dom';
import elementReady from 'element-ready';
-import {wrapAll} from './dom-utils';
+import {wrapAll} from './dom-utils.js';
export default async function addAfterBranchSelector(button: Element): Promise<void> {
button.classList.add('ml-2');
diff --git a/source/helpers/attach-element.ts b/source/helpers/attach-element.ts
index 381b301b..031925cf 100644
--- a/source/helpers/attach-element.ts
+++ b/source/helpers/attach-element.ts
@@ -2,7 +2,7 @@ import select from 'select-dom';
import {RequireAtLeastOne} from 'type-fest';
import {isDefined} from 'ts-extras';
-import getCallerID from './caller-id';
+import getCallerID from './caller-id.js';
type Position = 'append' | 'prepend' | 'before' | 'after' | 'forEach';
diff --git a/source/helpers/bisect.tsx b/source/helpers/bisect.tsx
index 82d3c2ba..d7014ca5 100644
--- a/source/helpers/bisect.tsx
+++ b/source/helpers/bisect.tsx
@@ -3,8 +3,8 @@ import cache from 'webext-storage-cache';
import select from 'select-dom';
import elementReady from 'element-ready';
-import pluralize from './pluralize';
-import featureLink from './feature-link';
+import pluralize from './pluralize.js';
+import featureLink from './feature-link.js';
import {importedFeatures} from '../../readme.md';
// Split current list of features in half and create an options-like object to be applied on load
diff --git a/source/helpers/calculate-css-calc-string.test.ts b/source/helpers/calculate-css-calc-string.test.ts
index c3d86439..fb670a37 100644
--- a/source/helpers/calculate-css-calc-string.test.ts
+++ b/source/helpers/calculate-css-calc-string.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import calculateCssCalcString from './calculate-css-calc-string';
+import calculateCssCalcString from './calculate-css-calc-string.js';
test('calculateCssCalcString', () => {
assert.equal(calculateCssCalcString('calc(1px)'), 1);
diff --git a/source/helpers/calculate-css-calc-string.ts b/source/helpers/calculate-css-calc-string.ts
index e711ca85..18527afd 100644
--- a/source/helpers/calculate-css-calc-string.ts
+++ b/source/helpers/calculate-css-calc-string.ts
@@ -1,4 +1,4 @@
-import looseParseInt from './loose-parse-int';
+import looseParseInt from './loose-parse-int.js';
/**
Compute the sum in a `calc()`. Only works with very simple sums of px values.
diff --git a/source/helpers/caller-id.test.ts b/source/helpers/caller-id.test.ts
index 42d93783..3cfa5ce5 100644
--- a/source/helpers/caller-id.test.ts
+++ b/source/helpers/caller-id.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import {getStackLine} from './caller-id';
+import {getStackLine} from './caller-id.js';
test('getCallerID: getStackLine', () => {
assert.equal(getStackLine('A\nB', 0), 'A');
diff --git a/source/helpers/caller-id.ts b/source/helpers/caller-id.ts
index a4fcefb1..91e1ab0e 100644
--- a/source/helpers/caller-id.ts
+++ b/source/helpers/caller-id.ts
@@ -1,4 +1,4 @@
-import hashString from './hash-string';
+import hashString from './hash-string.js';
/**
Get unique ID by using the line:column of the call (or its parents) as seed. Every call from the same place will return the same ID, as long as the index is set to the parents that matters to you.
diff --git a/source/helpers/clean-commit-message.test.ts b/source/helpers/clean-commit-message.test.ts
index 0ba95ec5..680d82dd 100644
--- a/source/helpers/clean-commit-message.test.ts
+++ b/source/helpers/clean-commit-message.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import cleanCommitMessage from './clean-commit-message';
+import cleanCommitMessage from './clean-commit-message.js';
test('cleanCommitMessage', () => {
const coauthors = [
diff --git a/source/helpers/click-all.ts b/source/helpers/click-all.ts
index 45dda857..9d38adff 100644
--- a/source/helpers/click-all.ts
+++ b/source/helpers/click-all.ts
@@ -2,7 +2,7 @@ import mem from 'mem';
import select from 'select-dom';
import {DelegateEvent} from 'delegate-it';
-import preserveScroll from './preserve-scroll';
+import preserveScroll from './preserve-scroll.js';
type EventHandler = (event: DelegateEvent<MouseEvent, HTMLElement>) => void;
export default mem((selector: string | ((clickedItem: HTMLElement) => string)): EventHandler => event => {
diff --git a/source/helpers/fetch-dom.ts b/source/helpers/fetch-dom.ts
index 39f5d9b2..7c7ffe65 100644
--- a/source/helpers/fetch-dom.ts
+++ b/source/helpers/fetch-dom.ts
@@ -1,8 +1,8 @@
import mem from 'mem';
import domify from 'doma';
-import type {ParseSelector} from 'typed-query-selector/parser';
+import type {ParseSelector} from 'typed-query-selector/parser.js';
-import features from '../feature-manager';
+import features from '../feature-manager.js';
async function fetchDom(url: string): Promise<DocumentFragment>;
async function fetchDom<Selector extends string, TElement extends HTMLElement = ParseSelector<Selector, HTMLElement>>(url: string, selector: Selector): Promise<TElement | undefined>;
diff --git a/source/helpers/get-items-between.test.ts b/source/helpers/get-items-between.test.ts
index ddeb12f0..9e9fe39f 100644
--- a/source/helpers/get-items-between.test.ts
+++ b/source/helpers/get-items-between.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import getItemsBetween from './get-items-between';
+import getItemsBetween from './get-items-between.js';
test('getItemsBetween', () => {
const list = ['❤️', '💛', '💚', '💙'];
diff --git a/source/helpers/hotfix.tsx b/source/helpers/hotfix.tsx
index 83dab02f..7ac7657d 100644
--- a/source/helpers/hotfix.tsx
+++ b/source/helpers/hotfix.tsx
@@ -4,8 +4,8 @@ import {isEnterprise} from 'github-url-detection';
import compareVersions from 'tiny-version-compare';
import {any as concatenateTemplateLiteralTag} from 'code-tag';
-import {RGHOptions} from '../options-storage';
-import isDevelopmentVersion from './is-development-version';
+import {RGHOptions} from '../options-storage.js';
+import isDevelopmentVersion from './is-development-version.js';
function parseCsv(content: string): string[][] {
const lines = [];
diff --git a/source/helpers/is-low-quality-comment.test.ts b/source/helpers/is-low-quality-comment.test.ts
index d24806b2..c01c602a 100644
--- a/source/helpers/is-low-quality-comment.test.ts
+++ b/source/helpers/is-low-quality-comment.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import isLowQualityComment from './is-low-quality-comment';
+import isLowQualityComment from './is-low-quality-comment.js';
test('isLowQualityComment', () => {
assert.isTrue(isLowQualityComment('+1'));
diff --git a/source/helpers/loose-parse-int.test.ts b/source/helpers/loose-parse-int.test.ts
index 06d058a8..a6662566 100644
--- a/source/helpers/loose-parse-int.test.ts
+++ b/source/helpers/loose-parse-int.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import looseParseInt from './loose-parse-int';
+import looseParseInt from './loose-parse-int.js';
test('looseParseInt', () => {
assert.equal(looseParseInt('1,234'), 1234);
diff --git a/source/helpers/on-element-replacement.ts b/source/helpers/on-element-replacement.ts
index a4ec40ae..27c555e4 100644
--- a/source/helpers/on-element-replacement.ts
+++ b/source/helpers/on-element-replacement.ts
@@ -1,6 +1,6 @@
import select from 'select-dom';
-import onElementRemoval from './on-element-removal';
+import onElementRemoval from './on-element-removal.js';
/**
Tracks the replacement of an element, identified via selector.
diff --git a/source/helpers/pluralize.test.ts b/source/helpers/pluralize.test.ts
index e5764970..07179189 100644
--- a/source/helpers/pluralize.test.ts
+++ b/source/helpers/pluralize.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import pluralize from './pluralize';
+import pluralize from './pluralize.js';
test('pluralize', () => {
assert.equal(pluralize(0, 'A number', '$$ numbers'), '0 numbers');
diff --git a/source/helpers/pr-commit-cleaner.test.ts b/source/helpers/pr-commit-cleaner.test.ts
index f7771ddf..d7b36d53 100644
--- a/source/helpers/pr-commit-cleaner.test.ts
+++ b/source/helpers/pr-commit-cleaner.test.ts
@@ -1,6 +1,6 @@
import {test, assert} from 'vitest';
-import cleanPrCommitTitle from './pr-commit-cleaner';
+import cleanPrCommitTitle from './pr-commit-cleaner.js';
test('cleanPrCommitTitle', () => {
const clean = 'Something done';
diff --git a/source/helpers/select-has.test.ts b/source/helpers/select-has.test.ts
index 13d4500b..251b6ae5 100644
--- a/source/helpers/select-has.test.ts
+++ b/source/helpers/select-has.test.ts
@@ -1,7 +1,7 @@
import {JSDOM} from 'jsdom';
import {test, assert} from 'vitest';
-import select from './select-has';
+import select from './select-has.js';
test('basic :has() support', () => {
const fragment = JSDOM.fragment(`
diff --git a/source/helpers/select-has.ts b/source/helpers/select-has.ts
index 1ed5f86a..29dd6756 100644
--- a/source/helpers/select-has.ts
+++ b/source/helpers/select-has.ts
@@ -1,4 +1,4 @@
-import {ParseSelector} from 'typed-query-selector/parser';
+import {ParseSelector} from 'typed-query-selector/parser.js';
const _isHasSelectorSupported = globalThis.CSS?.supports('selector(:has(a))');
export const isHasSelectorSupported = (): boolean => _isHasSelectorSupported;
diff --git a/source/helpers/selector-observer.tsx b/source/helpers/selector-observer.tsx
index 1beb3aca..522d1953 100644
--- a/source/helpers/selector-observer.tsx
+++ b/source/helpers/selector-observer.tsx
@@ -1,10 +1,10 @@
import React from 'dom-chef';
import {css} from 'code-tag';
import onetime from 'onetime';
-import {ParseSelector} from 'typed-query-selector/parser';
+import {ParseSelector} from 'typed-query-selector/parser.js';
-import getCallerID from './caller-id';
-import isDevelopmentVersion from './is-development-version';
+import getCallerID from './caller-id.js';
+import isDevelopmentVersion from './is-development-version.js';
type ObserverListener<ExpectedElement extends Element> = (element: ExpectedElement, options: SignalAsOptions) => void;
@@ -17,7 +17,7 @@ const getListener = <
selector: Selector,
callback: ObserverListener<ExpectedElement>,
signal?: AbortSignal,
-) => function (event: AnimationEvent) {
+) => (event: AnimationEvent) => {
const target = event.target as ExpectedElement;
// The target can match a selector even if the animation actually happened on a ::before pseudo-element, so it needs an explicit exclusion here
if (target.classList.contains(seenMark) || !target.matches(selector)) {
diff --git a/source/helpers/show-whitespace-on-line.test.ts b/source/helpers/show-whitespace-on-line.test.ts
index 33df817b..2b0f95f6 100644
--- a/source/helpers/show-whitespace-on-line.test.ts
+++ b/source/helpers/show-whitespace-on-line.test.ts
@@ -2,7 +2,7 @@ import {assert, test} from 'vitest';
import hl from 'highlight.js/lib/common';
-import showWhiteSpacesOnLine from './show-whitespace-on-line';
+import showWhiteSpacesOnLine from './show-whitespace-on-line.js';
function highlight(html: string): string {
// Use highlighter to create multiple text nodes
diff --git a/source/helpers/show-whitespace-on-line.tsx b/source/helpers/show-whitespace-on-line.tsx
index 05f24526..8a60b18f 100644
--- a/source/helpers/show-whitespace-on-line.tsx
+++ b/source/helpers/show-whitespace-on-line.tsx
@@ -1,6 +1,6 @@
import React from 'dom-chef';
-import getTextNodes from './get-text-nodes';
+import getTextNodes from './get-text-nodes.js';
// `splitText` is used before and after each whitespace group so a new whitespace-only text node is created. This new node is then wrapped in a <span>
export default function showWhiteSpacesOnLine(line: Element, shouldAvoidSurroundingSpaces = false): Element {
diff --git a/source/helpers/types.d.ts b/source/helpers/types.d.ts
index e3224b49..2299c002 100644
--- a/source/helpers/types.d.ts
+++ b/source/helpers/types.d.ts
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions -- Declaration merging necessary */
/* eslint-disable @typescript-eslint/ban-types -- The API does return `null`, not `undefined` */
-import type {StrictlyParseSelector} from 'typed-query-selector/parser';
+import type {StrictlyParseSelector} from 'typed-query-selector/parser.js';
declare global {
interface ParentNode {