1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

fix: return user profile theme colors as numbers

This commit is contained in:
CyberL1 2024-11-12 13:48:52 +01:00
parent c51595a6da
commit a11f3c0409
5 changed files with 82 additions and 22 deletions

View File

@ -1,14 +0,0 @@
{
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"root": true,
"rules": {
"no-mixed-spaces-and-tabs": "off",
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
"@typescript-eslint/no-var-requires": "off" // Sometimes requred by typeorm to resolve circular deps
},
"env": {
"node": true
}
}

45
eslint.config.mjs Normal file
View File

@ -0,0 +1,45 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [{
ignores: [
"**/node_modules",
"**/dist",
"**/README.md",
"**/COPYING",
"src/webrtc",
"**/scripts/",
"**/assets",
],
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
globals: {
...globals.node,
},
parser: tsParser,
},
rules: {
"no-mixed-spaces-and-tabs": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-var-requires": "off",
},
}];

38
package-lock.json generated
View File

@ -53,6 +53,8 @@
"ws": "^8.18.0" "ws": "^8.18.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@types/amqplib": "^0.10.5", "@types/amqplib": "^0.10.5",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@types/body-parser": "^1.19.5", "@types/body-parser": "^1.19.5",
@ -76,6 +78,7 @@
"@typescript-eslint/parser": "^8.12.2", "@typescript-eslint/parser": "^8.12.2",
"eslint": "^9.13.0", "eslint": "^9.13.0",
"express": "^4.21.1", "express": "^4.21.1",
"globals": "^15.12.0",
"husky": "^9.1.6", "husky": "^9.1.6",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"pretty-quick": "^4.0.0", "pretty-quick": "^4.0.0",
@ -1249,6 +1252,19 @@
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@ -1270,9 +1286,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "9.13.0", "version": "9.14.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz",
"integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -5878,6 +5894,16 @@
"url": "https://opencollective.com/eslint" "url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/eslint/node_modules/@eslint/js": {
"version": "9.13.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz",
"integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/eslint/node_modules/ajv": { "node_modules/eslint/node_modules/ajv": {
"version": "6.12.6", "version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@ -6735,9 +6761,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "14.0.0", "version": "15.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz",
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@ -38,6 +38,8 @@
}, },
"homepage": "https://spacebar.chat", "homepage": "https://spacebar.chat",
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@types/amqplib": "^0.10.5", "@types/amqplib": "^0.10.5",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@types/body-parser": "^1.19.5", "@types/body-parser": "^1.19.5",
@ -61,6 +63,7 @@
"@typescript-eslint/parser": "^8.12.2", "@typescript-eslint/parser": "^8.12.2",
"eslint": "^9.13.0", "eslint": "^9.13.0",
"express": "^4.21.1", "express": "^4.21.1",
"globals": "^15.12.0",
"husky": "^9.1.6", "husky": "^9.1.6",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"pretty-quick": "^4.0.0", "pretty-quick": "^4.0.0",

View File

@ -92,7 +92,7 @@ router.get(
accent_color: user.accent_color, accent_color: user.accent_color,
banner: user.banner, banner: user.banner,
pronouns: user.pronouns, pronouns: user.pronouns,
theme_colors: user.theme_colors, theme_colors: user.theme_colors?.map((t) => Number(t)), // these are strings for some reason, they should be numbers
}; };
const guildMemberProfile = { const guildMemberProfile = {