summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-02-24 13:46:53 +0800
committerGravatar GitHub <noreply@github.com> 2023-02-24 05:46:53 +0000
commit6e1be0b732b272b3bf58c4db0d9d76fb8ed5c11e (patch)
tree61797333abcef13af8dfd3c361f2e1b5ddb9f571
parentdd66045e46c27d95dee613d3afcd9ed69065ded4 (diff)
downloadrefined-github-6e1be0b732b272b3bf58c4db0d9d76fb8ed5c11e.tar.gz
refined-github-6e1be0b732b272b3bf58c4db0d9d76fb8ed5c11e.tar.zst
refined-github-6e1be0b732b272b3bf58c4db0d9d76fb8ed5c11e.zip
Meta: Update `typed-query-selector` (#6370)
-rw-r--r--package-lock.json14
-rw-r--r--package.json4
-rw-r--r--source/features/bypass-checks.tsx1
-rw-r--r--source/features/show-names.tsx4
-rw-r--r--source/features/sort-conversations-by-update-time.tsx4
-rw-r--r--source/helpers/types.d.ts8
6 files changed, 15 insertions, 20 deletions
diff --git a/package-lock.json b/package-lock.json
index d41fc637..0e5fc8b0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -76,7 +76,7 @@
"terser-webpack-plugin": "^5.3.6",
"ts-node": "^10.9.1",
"type-fest": "^3.5.7",
- "typed-query-selector": "^2.8.0",
+ "typed-query-selector": "^2.9.1",
"typescript": "^4.9.5",
"vitest": "^0.28.4",
"webpack": "^5.75.0",
@@ -9256,9 +9256,9 @@
}
},
"node_modules/typed-query-selector": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.8.0.tgz",
- "integrity": "sha512-jo9NLGQ0b7sT9TK3mxzemATQqTb/uh8TRvcOK6WSwKNewALt3AA8q2m7cdpF/uUbd/cdixaBxCGe6fpzpEWbGw=="
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.9.1.tgz",
+ "integrity": "sha512-947suHY5s2HRSllSwdMUS5kJBsM9FKLdd9OCxC6FWFVVIHodEy1IErYy+PuFGwxj/Vvc8gW7DgrBKdrsMEutjw=="
},
"node_modules/typescript": {
"version": "4.9.5",
@@ -17733,9 +17733,9 @@
}
},
"typed-query-selector": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.8.0.tgz",
- "integrity": "sha512-jo9NLGQ0b7sT9TK3mxzemATQqTb/uh8TRvcOK6WSwKNewALt3AA8q2m7cdpF/uUbd/cdixaBxCGe6fpzpEWbGw=="
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.9.1.tgz",
+ "integrity": "sha512-947suHY5s2HRSllSwdMUS5kJBsM9FKLdd9OCxC6FWFVVIHodEy1IErYy+PuFGwxj/Vvc8gW7DgrBKdrsMEutjw=="
},
"typescript": {
"version": "4.9.5",
diff --git a/package.json b/package.json
index 68ce2d39..6a0215df 100644
--- a/package.json
+++ b/package.json
@@ -112,7 +112,7 @@
"terser-webpack-plugin": "^5.3.6",
"ts-node": "^10.9.1",
"type-fest": "^3.5.7",
- "typed-query-selector": "^2.8.0",
+ "typed-query-selector": "^2.9.1",
"typescript": "^4.9.5",
"vitest": "^0.28.4",
"webpack": "^5.75.0",
@@ -134,4 +134,4 @@
]
}
}
-} \ No newline at end of file
+}
diff --git a/source/features/bypass-checks.tsx b/source/features/bypass-checks.tsx
index 0b7962ce..f8bc1602 100644
--- a/source/features/bypass-checks.tsx
+++ b/source/features/bypass-checks.tsx
@@ -37,7 +37,6 @@ function init(signal: AbortSignal): void {
[href^="/"]
)`,
- /* @ts-expect-error https://github.com/g-plane/typed-query-selector/issues/26 */
bypass,
{signal},
);
diff --git a/source/features/show-names.tsx b/source/features/show-names.tsx
index 55c19935..2b7ecb91 100644
--- a/source/features/show-names.tsx
+++ b/source/features/show-names.tsx
@@ -72,9 +72,7 @@ const usernameLinksSelector = [
// On dashboard `.text-bold` is required to not fetch avatars
'#dashboard a.text-bold[data-hovercard-type="user"]',
-
- // Due to: https://github.com/g-plane/typed-query-selector/issues/26
-] as unknown as Array<'a'>;
+] as const;
function init(signal: AbortSignal): void {
observe(usernameLinksSelector, batchUpdateLinks, {signal});
diff --git a/source/features/sort-conversations-by-update-time.tsx b/source/features/sort-conversations-by-update-time.tsx
index 99cec69f..9fa2dddb 100644
--- a/source/features/sort-conversations-by-update-time.tsx
+++ b/source/features/sort-conversations-by-update-time.tsx
@@ -1,7 +1,6 @@
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';
import elementReady from 'element-ready';
-import {css} from 'code-tag';
import features from '../feature-manager';
import SearchQuery from '../github-helpers/search-query';
@@ -57,7 +56,7 @@ function updateLink(link: HTMLAnchorElement): void {
function init(signal: AbortSignal): void {
// Get issues links that don't already have a specific sorting applied
observe(
- css`
+ `
a:is(
[href*="/issues"],
[href*="/pulls"],
@@ -68,7 +67,6 @@ function init(signal: AbortSignal): void {
.issues-reset-query
)
`,
- // @ts-expect-error https://github.com/g-plane/typed-query-selector/issues/26
updateLink,
{signal},
);
diff --git a/source/helpers/types.d.ts b/source/helpers/types.d.ts
index 332a1f1e..06f4cb80 100644
--- a/source/helpers/types.d.ts
+++ b/source/helpers/types.d.ts
@@ -1,18 +1,18 @@
/* 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 {ParseSelector} from 'typed-query-selector/parser';
+import type {StrictlyParseSelector} from 'typed-query-selector/parser';
declare global {
interface ParentNode {
- querySelector<S extends string>(selector: S | readonly S[]): ParseSelector<S, HTMLElement> | null;
+ querySelector<S extends string>(selector: S | readonly S[]): StrictlyParseSelector<S, HTMLElement> | null;
querySelectorAll<S extends string>(
selector: S | readonly S[],
- ): NodeListOf<ParseSelector<S, HTMLElement>>;
+ ): NodeListOf<StrictlyParseSelector<S, HTMLElement>>;
}
interface Element {
- closest<S extends string>(selector: S | readonly S[]): ParseSelector<S, HTMLElement> | null;
+ closest<S extends string>(selector: S | readonly S[]): StrictlyParseSelector<S, HTMLElement> | null;
matches(selectors: string | readonly string[]): boolean;
}
}