chore: upgrade eslint plugins, remove eslint-plugin-github

- Upgrade `typescript-eslint` to 8.61 and `eslint-plugin-unicorn` to 65,
  configuring the rules introduced in unicorn 65.
- Remove `eslint-plugin-github` and its workarounds: rules, the type-stub
  module declaration, the pnpm peer-dependency override, and the in-code
  `eslint-disable` comments that referenced its rules.
- Remove rules deprecated or deleted in their plugins and switch to their
  replacements (e.g. `prefer-single-call`, `no-object-constructor`,
  `id-denylist`, `no-unnecessary-slice-end`).
- Apply the resulting autofixes, mainly wrapping interpolated values in CSS
  selectors with `CSS.escape()`.

Assisted-by: claude-code:opus-4.8
This commit is contained in:
silverwind
2026-06-09 12:04:49 +02:00
parent 49a0d19fa3
commit 1b23df42df
18 changed files with 334 additions and 626 deletions
+2 -3
View File
@@ -9,8 +9,8 @@ type ElementsCallback<T extends Element> = (el: T) => Promisable<any>;
type ElementsCallbackWithArgs = (el: Element, ...args: any[]) => Promisable<any>;
function elementsCall(el: ElementArg, func: ElementsCallbackWithArgs, ...args: any[]): ArrayLikeIterable<Element> {
if (typeof el === 'string' || el instanceof String) {
el = document.querySelectorAll(el as string);
if (typeof el === 'string') {
el = document.querySelectorAll(el);
}
if (el instanceof Node) {
func(el, ...args);
@@ -268,7 +268,6 @@ export function isElemVisible(el: HTMLElement): boolean {
export function createElementFromHTML<T extends Element>(htmlString: string): T {
htmlString = htmlString.trim();
// There is no way to create some elements without a proper parent, jQuery's approach: https://github.com/jquery/jquery/blob/main/src/manipulation/wrapMap.js
// eslint-disable-next-line github/unescaped-html-literal
if (htmlString.startsWith('<tr')) {
const container = document.createElement('table');
container.innerHTML = htmlString;
+1 -1
View File
@@ -37,7 +37,7 @@ export function firstStartDateAfterDate(inputDate: Date): number {
}
const dayOfWeek = inputDate.getUTCDay();
const daysUntilSunday = 7 - dayOfWeek;
const resultDate = new Date(inputDate.getTime());
const resultDate = new Date(inputDate);
resultDate.setUTCDate(resultDate.getUTCDate() + daysUntilSunday);
return resultDate.valueOf();
}
+1 -1
View File
@@ -54,6 +54,6 @@ export function linkifyURLs(html: string): string {
const cleanUrl = trailingPunct ? url.slice(0, -trailingPunct[0].length) : url;
const trailing = trailingPunct ? trailingPunct[0] : '';
// safe because regexp only matches valid URLs (no quotes or angle brackets)
return `<a href="${cleanUrl}" target="_blank">${cleanUrl}</a>${trailing}`; // eslint-disable-line github/unescaped-html-literal
return `<a href="${cleanUrl}" target="_blank">${cleanUrl}</a>${trailing}`;
});
}