aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRini <rini@rinici.de>2023-08-10 00:17:49 +0000
committerVen <ven@noreply.codeberg.org>2023-08-10 00:17:49 +0000
commit8b6c8bc0ecedfea82370a253050657e5ca9d48f1 (patch)
treead9d718a7a9fc6099b532705342b30d07c8be55b
parent1a62249da6bd75981a75c6c7ce09e946336fc88e (diff)
downloadVencord-8b6c8bc0ecedfea82370a253050657e5ca9d48f1.tar.gz
Vencord-8b6c8bc0ecedfea82370a253050657e5ca9d48f1.tar.bz2
Vencord-8b6c8bc0ecedfea82370a253050657e5ca9d48f1.zip
chore: transition to shorter license headers (#6)
Transition from the GPL jumpscare to a more concise header: /* * Vencord, a Discord client mod * Copyright (c) 2023 Vendicated and contributors * * SPDX-License-Identifier: GPL-3.0 */ Old files still keep the old headers, while eslint will now autofix the new header Reviewed-on: https://codeberg.org/Ven/cord/pulls/6 Co-authored-by: Rini <rini@rinici.de> Co-committed-by: Rini <rini@rinici.de>
-rw-r--r--.eslintrc.json37
-rw-r--r--package.json7
-rw-r--r--patches/eslint-plugin-simple-header@1.0.1.patch13
-rw-r--r--pnpm-lock.yaml29
-rw-r--r--scripts/header-new.txt3
-rw-r--r--scripts/header-old.txt17
-rw-r--r--src/VencordNative.ts20
-rw-r--r--src/api/DataStore/index.ts2
-rw-r--r--src/components/VencordSettings/VencordTab.tsx1
-rw-r--r--src/main/themes/index.ts2
-rw-r--r--src/main/updater/common.ts1
-rw-r--r--src/main/utils/crxToZip.ts2
-rw-r--r--src/plugins/betterGifAltText.ts1
-rw-r--r--src/plugins/biggerStreamPreview/webpack/stores.ts1
-rw-r--r--src/plugins/clearURLs/defaultRules.ts1
-rw-r--r--src/plugins/mutualGroupDMs.tsx1
-rw-r--r--src/plugins/noPendingCount.ts1
-rw-r--r--src/plugins/reviewDB/reviewDbApi.ts1
-rw-r--r--src/plugins/shikiCodeblocks/api/shiki.ts1
-rw-r--r--src/plugins/shikiCodeblocks/previewExample.tsx2
-rw-r--r--src/plugins/startupTimings/index.tsx1
-rw-r--r--src/plugins/translate/languages.ts1
-rw-r--r--src/utils/constants.ts6
-rw-r--r--src/webpack/common/menu.ts1
24 files changed, 72 insertions, 80 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index e45e446..8fa3386 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -4,7 +4,7 @@
"ignorePatterns": ["dist", "browser"],
"plugins": [
"@typescript-eslint",
- "header",
+ "simple-header",
"simple-import-sort",
"unused-imports",
"path-alias"
@@ -26,35 +26,12 @@
// Since it's only been a month and Vencord has already been stolen
// by random skids who rebranded it to "AlphaCord" and erased all license
// information
- "header/header": [
- 2,
- "block",
- [
- {
- "pattern": "!?",
- "template": " "
- },
- " * Vencord, a modification for Discord's desktop app",
- {
- "pattern": " \\* Copyright \\(c\\) \\d{4}",
- "template": " * Copyright (c) 2023 Vendicated and contributors"
- },
- " *",
- " * This program is free software: you can redistribute it and/or modify",
- " * it under the terms of the GNU General Public License as published by",
- " * the Free Software Foundation, either version 3 of the License, or",
- " * (at your option) any later version.",
- " *",
- " * This program is distributed in the hope that it will be useful,",
- " * but WITHOUT ANY WARRANTY; without even the implied warranty of",
- " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
- " * GNU General Public License for more details.",
- " *",
- " * You should have received a copy of the GNU General Public License",
- " * along with this program. If not, see <https://www.gnu.org/licenses/>.",
- ""
- ],
- 2
+ "simple-header/header": [
+ "error",
+ {
+ "files": ["scripts/header-new.txt", "scripts/header-old.txt"],
+ "templates": { "author": [".*", "Vendicated and contributors"] }
+ }
],
"quotes": ["error", "double", { "avoidEscape": true }],
"jsx-quotes": ["error", "prefer-double"],
diff --git a/package.json b/package.json
index 51f6d09..5444bf0 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
"type": "git",
"url": "git+https://github.com/Vendicated/Vencord.git"
},
- "license": "GPL-3.0",
+ "license": "GPL-3.0-or-later",
"author": "Vendicated",
"directories": {
"doc": "docs"
@@ -33,6 +33,7 @@
"dependencies": {
"@vap/core": "0.0.12",
"@vap/shiki": "0.10.5",
+ "eslint-plugin-simple-header": "^1.0.1",
"fflate": "^0.7.4",
"nanoid": "^4.0.2",
"virtual-merge": "^1.0.1"
@@ -51,7 +52,6 @@
"esbuild": "^0.15.18",
"eslint": "^8.28.0",
"eslint-import-resolver-alias": "^1.1.2",
- "eslint-plugin-header": "^3.1.1",
"eslint-plugin-path-alias": "^1.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
@@ -69,7 +69,8 @@
"pnpm": {
"patchedDependencies": {
"eslint-plugin-path-alias@1.0.0": "patches/eslint-plugin-path-alias@1.0.0.patch",
- "eslint@8.28.0": "patches/eslint@8.28.0.patch"
+ "eslint@8.28.0": "patches/eslint@8.28.0.patch",
+ "eslint-plugin-simple-header@1.0.1": "patches/eslint-plugin-simple-header@1.0.1.patch"
},
"peerDependencyRules": {
"ignoreMissing": [
diff --git a/patches/eslint-plugin-simple-header@1.0.1.patch b/patches/eslint-plugin-simple-header@1.0.1.patch
new file mode 100644
index 0000000..bb82fb1
--- /dev/null
+++ b/patches/eslint-plugin-simple-header@1.0.1.patch
@@ -0,0 +1,13 @@
+diff --git a/src/index.js b/src/index.js
+index e8a8ee34fbafe310c75e752d59ba3a56109d67f1..6aecfe40f863823c8b115bca00537fcd78934137 100644
+--- a/src/index.js
++++ b/src/index.js
+@@ -95,7 +95,7 @@ function create(ctx) {
+ ?? [Array.isArray(options.text) ? options.text.join("\n") : options.text];
+
+ /** @type {string} */
+- const src = ctx.sourceCode.getText();
++ const src = ctx.getSourceCode().getText();
+ const srcHeader = findHeader(src, syntax);
+ const headers = rawHeaders.map((raw) => makeComment(raw, syntax, decor));
+ const trailingLines = "\n".repeat(src.slice(srcHeader.length).trim() ? 1 + newlines : 1); \ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c437371..8523f7b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,9 +1,16 @@
lockfileVersion: '6.0'
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
patchedDependencies:
eslint-plugin-path-alias@1.0.0:
hash: m6sma4g6bh67km3q6igf6uxaja
path: patches/eslint-plugin-path-alias@1.0.0.patch
+ eslint-plugin-simple-header@1.0.1:
+ hash: ej6cxkrs2np2767qe2tatjdt54
+ path: patches/eslint-plugin-simple-header@1.0.1.patch
eslint@8.28.0:
hash: 7wc6icvgtg3uswirb5tpsbjnbe
path: patches/eslint@8.28.0.patch
@@ -15,6 +22,9 @@ dependencies:
'@vap/shiki':
specifier: 0.10.5
version: 0.10.5
+ eslint-plugin-simple-header:
+ specifier: ^1.0.1
+ version: 1.0.1(patch_hash=ej6cxkrs2np2767qe2tatjdt54)
fflate:
specifier: ^0.7.4
version: 0.7.4
@@ -65,9 +75,6 @@ devDependencies:
eslint-import-resolver-alias:
specifier: ^1.1.2
version: 1.1.2
- eslint-plugin-header:
- specifier: ^3.1.1
- version: 3.1.1(eslint@8.28.0)
eslint-plugin-path-alias:
specifier: ^1.0.0
version: 1.0.0(patch_hash=m6sma4g6bh67km3q6igf6uxaja)(eslint@8.28.0)
@@ -1446,17 +1453,6 @@ packages:
optional: true
dev: true
- /eslint-plugin-header@3.1.1(eslint@8.28.0):
- resolution: {integrity: sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==}
- peerDependencies:
- eslint: '>=7.7.0'
- peerDependenciesMeta:
- eslint:
- optional: true
- dependencies:
- eslint: 8.28.0(patch_hash=7wc6icvgtg3uswirb5tpsbjnbe)
- dev: true
-
/eslint-plugin-path-alias@1.0.0(patch_hash=m6sma4g6bh67km3q6igf6uxaja)(eslint@8.28.0):
resolution: {integrity: sha512-FXus57yC+Zd3sMv46pbloXYwFeNVNHJqlACr9V68FG/IzGFBBokGJpmjDbEjpt8ZCeVSndUubeDWWl2A8sCNVQ==}
peerDependencies:
@@ -1472,6 +1468,11 @@ packages:
dev: true
patched: true
+ /eslint-plugin-simple-header@1.0.1(patch_hash=ej6cxkrs2np2767qe2tatjdt54):
+ resolution: {integrity: sha512-vpTMgF7bOIflnczDmbfTKtYhjTsPLTTjv/whkh1rXtu4Jp2NtvJr57gJB8QOzNjXyh34/D/LA2NY7tZsebKoZg==}
+ dev: false
+ patched: true
+
/eslint-plugin-simple-import-sort@10.0.0(eslint@8.28.0):
resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==}
peerDependencies:
diff --git a/scripts/header-new.txt b/scripts/header-new.txt
new file mode 100644
index 0000000..0db705d
--- /dev/null
+++ b/scripts/header-new.txt
@@ -0,0 +1,3 @@
+Vencord, a Discord client mod
+Copyright (c) {year} {author}
+SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/scripts/header-old.txt b/scripts/header-old.txt
new file mode 100644
index 0000000..8bb4024
--- /dev/null
+++ b/scripts/header-old.txt
@@ -0,0 +1,17 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) {year} {author}
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
diff --git a/src/VencordNative.ts b/src/VencordNative.ts
index da09ade..58f553c 100644
--- a/src/VencordNative.ts
+++ b/src/VencordNative.ts
@@ -1,20 +1,8 @@
/*
- * Vencord, a modification for Discord's desktop app
- * Copyright (c) 2022
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
-*/
+ * Vencord, a Discord client mod
+ * Copyright (c) 2023 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
import { IpcEvents } from "@utils/IpcEvents";
import { IpcRes } from "@utils/types";
diff --git a/src/api/DataStore/index.ts b/src/api/DataStore/index.ts
index 49c8595..97f43ed 100644
--- a/src/api/DataStore/index.ts
+++ b/src/api/DataStore/index.ts
@@ -1,4 +1,4 @@
-/* eslint-disable header/header */
+/* eslint-disable simple-header/header */
/*!
* idb-keyval v6.2.0
diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx
index 1502bfa..a80b79a 100644
--- a/src/components/VencordSettings/VencordTab.tsx
+++ b/src/components/VencordSettings/VencordTab.tsx
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { openNotificationLogModal } from "@api/Notifications/notificationLog";
import { Settings, useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
diff --git a/src/main/themes/index.ts b/src/main/themes/index.ts
index f660e50..0751663 100644
--- a/src/main/themes/index.ts
+++ b/src/main/themes/index.ts
@@ -1,4 +1,4 @@
-/* eslint-disable header/header */
+/* eslint-disable simple-header/header */
/*!
* BetterDiscord addon meta parser
diff --git a/src/main/updater/common.ts b/src/main/updater/common.ts
index 7cea82d..69832d1 100644
--- a/src/main/updater/common.ts
+++ b/src/main/updater/common.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
export const VENCORD_FILES = [
IS_DISCORD_DESKTOP ? "patcher.js" : "vencordDesktopMain.js",
"preload.js",
diff --git a/src/main/utils/crxToZip.ts b/src/main/utils/crxToZip.ts
index ca43890..f018629 100644
--- a/src/main/utils/crxToZip.ts
+++ b/src/main/utils/crxToZip.ts
@@ -1,4 +1,4 @@
-/* eslint-disable header/header */
+/* eslint-disable simple-header/header */
/*!
* crxToZip
diff --git a/src/plugins/betterGifAltText.ts b/src/plugins/betterGifAltText.ts
index 5e0191b..dcffc02 100644
--- a/src/plugins/betterGifAltText.ts
+++ b/src/plugins/betterGifAltText.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
diff --git a/src/plugins/biggerStreamPreview/webpack/stores.ts b/src/plugins/biggerStreamPreview/webpack/stores.ts
index e8a4ee2..ba5227b 100644
--- a/src/plugins/biggerStreamPreview/webpack/stores.ts
+++ b/src/plugins/biggerStreamPreview/webpack/stores.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { findStoreLazy } from "@webpack";
import * as t from "./types/stores";
diff --git a/src/plugins/clearURLs/defaultRules.ts b/src/plugins/clearURLs/defaultRules.ts
index 5a5f135..b162bbc 100644
--- a/src/plugins/clearURLs/defaultRules.ts
+++ b/src/plugins/clearURLs/defaultRules.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
export const defaultRules = [
"action_object_map",
"action_type_map",
diff --git a/src/plugins/mutualGroupDMs.tsx b/src/plugins/mutualGroupDMs.tsx
index a365813..d445522 100644
--- a/src/plugins/mutualGroupDMs.tsx
+++ b/src/plugins/mutualGroupDMs.tsx
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { Devs } from "@utils/constants";
import { isNonNullish } from "@utils/guards";
import definePlugin from "@utils/types";
diff --git a/src/plugins/noPendingCount.ts b/src/plugins/noPendingCount.ts
index 0de3ecd..2ce375e 100644
--- a/src/plugins/noPendingCount.ts
+++ b/src/plugins/noPendingCount.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
diff --git a/src/plugins/reviewDB/reviewDbApi.ts b/src/plugins/reviewDB/reviewDbApi.ts
index e3ab8a8..e8008c8 100644
--- a/src/plugins/reviewDB/reviewDbApi.ts
+++ b/src/plugins/reviewDB/reviewDbApi.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { Review, ReviewDBUser } from "./entities";
import { settings } from "./settings";
import { authorize, showToast } from "./utils";
diff --git a/src/plugins/shikiCodeblocks/api/shiki.ts b/src/plugins/shikiCodeblocks/api/shiki.ts
index e7691ce..91e179b 100644
--- a/src/plugins/shikiCodeblocks/api/shiki.ts
+++ b/src/plugins/shikiCodeblocks/api/shiki.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { shikiOnigasmSrc, shikiWorkerSrc } from "@utils/dependencies";
import { WorkerClient } from "@vap/core/ipc";
import type { IShikiTheme, IThemedToken } from "@vap/shiki";
diff --git a/src/plugins/shikiCodeblocks/previewExample.tsx b/src/plugins/shikiCodeblocks/previewExample.tsx
index 971d016..508153b 100644
--- a/src/plugins/shikiCodeblocks/previewExample.tsx
+++ b/src/plugins/shikiCodeblocks/previewExample.tsx
@@ -1,4 +1,4 @@
-/* eslint-disable header/header */
+/* eslint-disable simple-header/header */
import React from "react";
const handleClick = async () =>
diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx
index acb11c9..3eec9d0 100644
--- a/src/plugins/startupTimings/index.tsx
+++ b/src/plugins/startupTimings/index.tsx
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
import { Devs } from "@utils/constants";
import { LazyComponent } from "@utils/react";
import definePlugin from "@utils/types";
diff --git a/src/plugins/translate/languages.ts b/src/plugins/translate/languages.ts
index c3be053..4bf370b 100644
--- a/src/plugins/translate/languages.ts
+++ b/src/plugins/translate/languages.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
/*
To generate:
- Visit https://translate.google.com/?sl=auto&tl=en&op=translate
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 9771f42..667e396 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -334,7 +334,11 @@ export const Devs = /* #__PURE__*/ Object.freeze({
HypedDomi: {
name: "HypedDomi",
id: 354191516979429376n
- }
+ },
+ Rini: {
+ name: "Rini",
+ id: 1079479184478441643n
+ },
} satisfies Record<string, Dev>);
// iife so #__PURE__ works correctly
diff --git a/src/webpack/common/menu.ts b/src/webpack/common/menu.ts
index 97d1d2f..e2ad372 100644
--- a/src/webpack/common/menu.ts
+++ b/src/webpack/common/menu.ts
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
// eslint-disable-next-line path-alias/no-relative
import { filters, mapMangledModuleLazy, waitFor } from "../webpack";
import type * as t from "./types/menu";