From 877339c8af23baa9be6b5de4b74b7b2f517618d8 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 17 Dec 2025 06:55:55 +0100 Subject: [PATCH] Prettier a few files --- .prettierignore | 5 ++++- .prettierrc.json | 2 +- eslint.config.mjs | 15 ++------------- scripts/genIndex.js | 6 +++--- scripts/license.js | 7 +------ src/util/migration/postgres-initial.ts | 1 - tsconfig.json | 12 ++++-------- 7 files changed, 15 insertions(+), 33 deletions(-) diff --git a/.prettierignore b/.prettierignore index a1e4b5b16..185e5af0e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,4 +5,7 @@ node_modules .vscode hashes.json flake.lock -extra/admin-api \ No newline at end of file +extra/admin-api +discord-response-samples +src/util/migration/postgres-initial.ts +scripts/stagingMigrat \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index cbb8af098..a9a4a2319 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -9,5 +9,5 @@ "useTabs": true, "singleQuote": false, "endOfLine": "auto", - "printWidth": 180 + "printWidth": 180 } diff --git a/eslint.config.mjs b/eslint.config.mjs index 134c5c076..d0c065832 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -16,20 +16,9 @@ const compat = new FlatCompat({ export default [ { - ignores: [ - "**/node_modules", - "**/dist", - "**/README.md", - "**/COPYING", - "**/scripts/", - "**/assets", - "**/extra/", - ], + ignores: ["**/node_modules", "**/dist", "**/README.md", "**/COPYING", "**/scripts/", "**/assets", "**/extra/"], }, - ...compat.extends( - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - ), + ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), { plugins: { "@typescript-eslint": typescriptEslint, diff --git a/scripts/genIndex.js b/scripts/genIndex.js index 701a7566b..c1b682274 100644 --- a/scripts/genIndex.js +++ b/scripts/genIndex.js @@ -50,12 +50,12 @@ if (fs.existsSync(path.join(targetDir, "index.js")) || fs.existsSync(path.join(t process.exit(1); } -const dirs = fs.readdirSync(targetDir).filter(f => fs.statSync(path.join(targetDir, f)).isDirectory()); +const dirs = fs.readdirSync(targetDir).filter((f) => fs.statSync(path.join(targetDir, f)).isDirectory()); for (const dir of dirs) { content += `export * from "./${dir}";\n`; } -const files = fs.readdirSync(targetDir).filter(f => f.endsWith(".js") || f.endsWith(".ts")); +const files = fs.readdirSync(targetDir).filter((f) => f.endsWith(".js") || f.endsWith(".ts")); for (const file of files) { const filePath = path.join(targetDir, file); const stat = fs.statSync(filePath); @@ -66,4 +66,4 @@ for (const file of files) { } } -fs.writeFileSync(path.join(targetDir, "index.ts"), content); \ No newline at end of file +fs.writeFileSync(path.join(targetDir, "index.ts"), content); diff --git a/scripts/license.js b/scripts/license.js index b12080dd9..380a3ed6f 100644 --- a/scripts/license.js +++ b/scripts/license.js @@ -34,12 +34,7 @@ const addToDir = (dir) => { const commentStrings = languageCommentStrings[fileType]; if (!commentStrings) continue; - const preamble = - commentStrings[0] + - "\n" + - SPACEBAR_LICENSE_PREAMBLE + - "\n" + - commentStrings[1]; + const preamble = commentStrings[0] + "\n" + SPACEBAR_LICENSE_PREAMBLE + "\n" + commentStrings[1]; if (file.startsWith(preamble)) { continue; diff --git a/src/util/migration/postgres-initial.ts b/src/util/migration/postgres-initial.ts index 769794175..20a747c2d 100644 --- a/src/util/migration/postgres-initial.ts +++ b/src/util/migration/postgres-initial.ts @@ -1,4 +1,3 @@ -// @prettier-ignore /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2025 Spacebar and Spacebar Contributors diff --git a/tsconfig.json b/tsconfig.json index 61c415ccd..374aedfea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,9 +13,7 @@ /* Language and Environment */ "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - "lib": [ - "ESNext" - ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, + "lib": ["ESNext"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, // "jsx": "preserve", /* Specify what JSX code is generated. */ "experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */, "emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */, @@ -33,20 +31,18 @@ "moduleResolution": "nodenext" /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./src/", //deprecated "paths": { - //"*": ["./src/*"], + //"*": ["./src/*"], "@spacebar/api*": ["./src/api"], "@spacebar/gateway*": ["./src/gateway"], "@spacebar/cdn*": ["./src/cdn"], "@spacebar/util*": ["./src/util"], "@spacebar/webrtc*": ["./src/webrtc"], "@spacebar/schemas*": ["./src/schemas"], - "lambert-server*": ["./src/util/util/lambert-server"] + "lambert-server*": ["./src/util/util/lambert-server"] } /* Specify a set of entries that re-map imports to additional lookup locations. */, // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - "types": [ - "node" - ] /* Specify type package names to be included without being referenced in a source file. */, + "types": ["node"] /* Specify type package names to be included without being referenced in a source file. */, // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ "resolveJsonModule": true /* Enable importing .json files. */,