<\/a> (? <\/a> (?
- A submission via enter has been prevented. You can press enter again or use {moduleKey}enter.
+ A submission via enter has been prevented. You can press enter again or use{' '}
+ {moduleKey}
+ enter.
- The description field was cleared by Refined GitHub.
+ The description field was cleared by{' '}
+
+ Refined GitHub
+ .
/g;
+const highlightedFeatureRegex
+ = /
/g;
const featureRegex = regexJoinWithSeparator('|', [simpleFeatureRegex, highlightedFeatureRegex]);
const imageRegex = /\.\w{3}$/; // 3 since .png and .gif have 3 letters
const rghUploadsRegex = /refined-github[/]refined-github[/]assets[/]/;
diff --git a/dprint.json b/dprint.json
index dad5455f02b3..4312e7965ee3 100644
--- a/dprint.json
+++ b/dprint.json
@@ -3,12 +3,14 @@
"plugins": [
"./node_modules/dprint-plugin-markup/plugin.wasm",
"./node_modules/dprint-plugin-malva/plugin.wasm",
- "./node_modules/dprint-plugin-graphql/plugin.wasm"
+ "./node_modules/dprint-plugin-graphql/plugin.wasm",
+ "./node_modules/@dprint/json/plugin.wasm"
],
"includes": [
"**/*.svelte",
"**/*.css",
- "**/*.gql"
+ "**/*.gql",
+ "dprint.json"
],
"useTabs": true,
"markup": {
diff --git a/eslint.config.js b/eslint.config.js
index 5b3779032672..7a5493b1f59a 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -1,7 +1,7 @@
import xo from 'xo';
import sveltePlugin from 'eslint-plugin-svelte';
import svelteParser from 'svelte-eslint-parser';
-import eslintConfigPrettier from 'eslint-config-prettier';
+import eslintConfigPrettier from 'eslint-config-prettier/flat';
import {includeIgnoreFile} from '@eslint/compat';
import {fileURLToPath} from 'node:url';
@@ -316,6 +316,8 @@ export default [
location: 'readonly',
},
},
+
+ // TODO: Use global `/flat` config. Currently limited to svelte files because dprint is applied to their JS
rules: eslintConfigPrettier.rules,
},
{
diff --git a/package-lock.json b/package-lock.json
index 9475512a27b0..8d4b3ecacd27 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -56,6 +56,7 @@
},
"devDependencies": {
"@biomejs/biome": "^2.3.12",
+ "@dprint/json": "^0.21.3",
"@eslint-react/eslint-plugin": "^2.7.2",
"@eslint/compat": "^2.0.1",
"@rollup/plugin-alias": "^6.0.0",
@@ -328,6 +329,13 @@
"darwin"
]
},
+ "node_modules/@dprint/json": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@dprint/json/-/json-0.21.3.tgz",
+ "integrity": "sha512-fOmRKstf4kVZunnJcrGg1SNzoU6Y11mnLR1SbHQ7PwVvOUQTTUeCtxm3oLy/56nf69kaZmrdeegWXyxnTM5WDQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@dprint/linux-arm64-glibc": {
"version": "0.54.0",
"resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.54.0.tgz",
diff --git a/package.json b/package.json
index fbb55e9381a3..e5ad39c38484 100644
--- a/package.json
+++ b/package.json
@@ -6,12 +6,12 @@
"build": "run-p build:* --continue-on-error",
"build:typescript": "tsc --noEmit",
"build:bundle": "rollup -c",
- "fix": "run-p \"lint:biome -- --write\" \"lint:js -- --fix\" format \"vitest -- --update\" --continue-on-error",
+ "fix": "run-p format \"lint:css -- --write\" \"lint:js -- --fix\" \"vitest -- --update\" --continue-on-error",
"format": "dprint fmt",
+ "format:check": "dprint check",
"lint": "run-p lint:* --continue-on-error",
"lint:js": "eslint .",
- "lint:biome": "biome lint",
- "lint:dprint": "dprint check",
+ "lint:css": "biome lint",
"new": "bash build/new-feature.sh",
"pack:safari": "xcodebuild -project 'safari/Refined GitHub.xcodeproj' -scheme 'Refined GitHub' -destination 'platform=macOS'",
"prepare:safari": "bash build/prepare-safari-release.sh",
@@ -73,6 +73,7 @@
},
"devDependencies": {
"@biomejs/biome": "^2.3.12",
+ "@dprint/json": "^0.21.3",
"@eslint-react/eslint-plugin": "^2.7.2",
"@eslint/compat": "^2.0.1",
"@rollup/plugin-alias": "^6.0.0",
diff --git a/source/background.ts b/source/background.ts
index 67c626165e4f..125866d65baa 100644
--- a/source/background.ts
+++ b/source/background.ts
@@ -27,7 +27,9 @@ if (!isSafari()) {
addReloadWithoutContentScripts();
// Extend the error message for the "No All URLs" bugfix
-customizeNoAllUrlsErrorMessage('Refined GitHub is not meant to run on every website. If youâre looking to enable it on GitHub Enterprise, follow the instructions in the Options page.');
+customizeNoAllUrlsErrorMessage(
+ 'Refined GitHub is not meant to run on every website. If youâre looking to enable it on GitHub Enterprise, follow the instructions in the Options page.',
+);
handleMessages({
async openUrls(urls: string[], {tab}: chrome.runtime.MessageSender) {
diff --git a/source/feature-manager.tsx b/source/feature-manager.tsx
index 499915102fdb..33496cd33e4d 100644
--- a/source/feature-manager.tsx
+++ b/source/feature-manager.tsx
@@ -1,34 +1,30 @@
/* eslint-disable no-await-in-loop -- Event loops */
import React from 'dom-chef';
-import {elementExists} from 'select-dom';
import domLoaded from 'dom-loaded';
+import * as pageDetect from 'github-url-detection';
+import oneEvent from 'one-event';
+import {elementExists} from 'select-dom';
import stripIndent from 'strip-indent';
import type {Promisable} from 'type-fest';
-import * as pageDetect from 'github-url-detection';
import {isWebPage} from 'webext-detect';
import {messageRuntime} from 'webext-msg';
-import oneEvent from 'one-event';
-import waitFor from './helpers/wait-for.js';
-import ArrayMap from './helpers/map-of-arrays.js';
+import asyncForEach from './helpers/async-for-each.js';
import bisectFeatures from './helpers/bisect.js';
+import {catchErrors, disableErrorLogging} from './helpers/errors.js';
import {
- shouldFeatureRun,
- isFeaturePrivate,
- type RunConditions,
-} from './helpers/feature-utils.js';
-import optionsStorage, {isFeatureDisabled, type RghOptions} from './options-storage.js';
+ getFeatureId, listenToAjaxedLoad, log, shortcutMap,
+} from './helpers/feature-helpers.js';
+import {isFeaturePrivate, type RunConditions, shouldFeatureRun} from './helpers/feature-utils.js';
import {
applyStyleHotfixes,
+ brokenFeatures,
getLocalHotfixesAsOptions,
preloadSyncLocalStrings,
- brokenFeatures,
} from './helpers/hotfix.js';
-import asyncForEach from './helpers/async-for-each.js';
-import {catchErrors, disableErrorLogging} from './helpers/errors.js';
-import {
- getFeatureId, listenToAjaxedLoad, log, shortcutMap,
-} from './helpers/feature-helpers.js';
+import ArrayMap from './helpers/map-of-arrays.js';
+import waitFor from './helpers/wait-for.js';
+import optionsStorage, {isFeatureDisabled, type RghOptions} from './options-storage.js';
import {contentScriptToggle} from './options/reload-without.js';
type FeatureInitResult = void | false;
diff --git a/source/features/action-pr-link.tsx b/source/features/action-pr-link.tsx
index 53264a40228a..2ea2418b4bf2 100644
--- a/source/features/action-pr-link.tsx
+++ b/source/features/action-pr-link.tsx
@@ -27,10 +27,14 @@ async function initForRepositoryActionsPage(signal: AbortSignal): Promise