返回提交历史
Modified
.eslintrc
+13
-8
Modified
.github/workflows/build.yml
+1
-0
Modified
src/controllers/api/artifactsController.ts
+0
-1
Modified
src/controllers/api/claimCompletedRecipeController.ts
+0
-1
Modified
src/controllers/api/getGuildDojoController.ts
+1
-1
Modified
src/controllers/api/getShipController.ts
+0
-1
Modified
src/controllers/api/inventoryController.ts
+1
-1
Modified
src/controllers/api/loginController.ts
+1
-1
Modified
src/controllers/api/logoutController.ts
+1
-2
Modified
src/controllers/api/updateChallengeProgressController.ts
+1
-1
Modified
src/controllers/api/upgradesController.ts
+1
-1
Modified
src/controllers/stats/viewController.ts
+1
-1
Modified
src/helpers/customHelpers/addItemHelpers.ts
+1
-1
Modified
src/index.ts
+2
-3
Modified
src/models/inventoryModels/inventoryModel.ts
+1
-0
Modified
src/models/inventoryModels/loadoutModel.ts
+1
-0
Modified
src/pathman.ts
+1
-0
Modified
src/types/personalRoomsTypes.ts
+1
-0
Modified
src/types/requestTypes.ts
+1
-1
XFEstudio/XFESpaceNinjaServer
improve: ensure 'npm run lint' passes without errors (#249)
e3f543d9
代码差异
19 个文件
+29
-24
@@ -4,22 +4,27 @@
4
4
"plugin:@typescript-eslint/recommended",
5
5
"plugin:@typescript-eslint/recommended-requiring-type-checking"
6
6
],
7
"plugins": ["@typescript-eslint", "prettier"],
7
"plugins": ["@typescript-eslint"],
8
8
"env": {
9
9
"browser": true,
10
10
"es6": true,
11
11
"node": true
12
12
},
13
13
"rules": {
14
"prettier/prettier": "error",
15
14
"@typescript-eslint/semi": ["error"],
16
"@typescript-eslint/explicit-function-return-type": "off",
17
"@typescript-eslint/explicit-module-boundary-types": "off",
18
"@typescript-eslint/restrict-template-expressions": "off",
19
"@typescript-eslint/restrict-plus-operands": "off",
20
"@typescript-eslint/no-unsafe-member-access": "off",
15
"@typescript-eslint/explicit-function-return-type": "warn",
16
"@typescript-eslint/explicit-module-boundary-types": "warn",
17
"@typescript-eslint/restrict-template-expressions": "warn",
18
"@typescript-eslint/restrict-plus-operands": "warn",
19
"@typescript-eslint/no-unsafe-member-access": "warn",
21
20
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
22
"no-case-declarations": "off"
21
"@typescript-eslint/no-misused-promises": "warn",
22
"@typescript-eslint/no-unsafe-argument": "warn",
23
"@typescript-eslint/no-unsafe-call": "warn",
24
"@typescript-eslint/no-unsafe-assignment": "warn",
25
"@typescript-eslint/no-explicit-any": "warn",
26
"@typescript-eslint/no-loss-of-precision": "warn",
27
"no-case-declarations": "warn"
23
28
},
24
29
"parser": "@typescript-eslint/parser",
25
30
"parserOptions": {
@@ -18,3 +18,4 @@ jobs:
18
18
- run: cp config.json.example config.json
19
19
- run: echo '{"version":"","buildLabel":"","matchmakingBuildId":""}' > static/data/buildConfig.json
20
20
- run: npm run build
21
- run: npm run lint
@@ -1,4 +1,3 @@
1
import { parseString } from "@/src/helpers/general";
2
1
import { getJSONfromString } from "@/src/helpers/stringHelpers";
3
2
import { getAccountIdForRequest } from "@/src/services/loginService";
4
3
import { upgradeMod } from "@/src/services/inventoryService";
@@ -8,7 +8,6 @@ import { IOid } from "@/src/types/commonTypes";
8
8
import { getJSONfromString } from "@/src/helpers/stringHelpers";
9
9
import { getAccountIdForRequest } from "@/src/services/loginService";
10
10
import { getInventory } from "@/src/services/inventoryService";
11
import { IInventoryDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
12
11
13
12
export interface IClaimCompletedRecipeRequest {
14
13
RecipeIds: IOid[];
@@ -23,7 +23,7 @@ export const getGuildDojoController: RequestHandler = async (req, res) => {
23
23
CompletionTime: new Date(Date.now())
24
24
}
25
25
];
26
guild.save();
26
await guild.save();
27
27
}
28
28
29
29
const dojo: IDojoClient = {
@@ -4,7 +4,6 @@ import allShipFeatures from "@/static/fixed_responses/allShipFeatures.json";
4
4
import { getAccountIdForRequest } from "@/src/services/loginService";
5
5
import { getPersonalRooms } from "@/src/services/personalRoomsService";
6
6
import { getShip } from "@/src/services/shipService";
7
import { PersonalRooms } from "@/src/models/personalRoomsModel";
8
7
import { Loadout } from "@/src/models/inventoryModels/loadoutModel";
9
8
import { logger } from "@/src/utils/logger";
10
9
import { toOid } from "@/src/helpers/inventoryHelpers";
@@ -56,7 +56,7 @@ const inventoryController: RequestHandler = async (request: Request, response: R
56
56
57
57
if (config.unlockAllSkins) {
58
58
inventoryResponse.WeaponSkins = [];
59
for (let skin of allSkins) {
59
for (const skin of allSkins) {
60
60
inventoryResponse.WeaponSkins.push({
61
61
ItemId: {
62
62
$oid: "000000000000000000000000"
@@ -66,7 +66,7 @@ const loginController: RequestHandler = async (request, response) => {
66
66
67
67
if (account.Nonce == 0 || loginRequest.ClientType != "webui") {
68
68
account.Nonce = nonce;
69
account.save();
69
await account.save();
70
70
}
71
71
72
72
const { email, password, ...databaseAccount } = account.toJSON();
@@ -1,14 +1,13 @@
1
1
import { RequestHandler } from "express";
2
2
import { getAccountIdForRequest } from "@/src/services/loginService";
3
3
import { Account } from "@/src/models/loginModel";
4
import { IDatabaseAccountDocument } from "@/src/types/loginTypes";
5
4
6
5
const logoutController: RequestHandler = async (req, res) => {
7
6
const accountId = await getAccountIdForRequest(req);
8
7
const account = await Account.findOne({ _id: accountId });
9
8
if (account) {
10
9
account.Nonce = 0;
11
account.save();
10
await account.save();
12
11
}
13
12
res.writeHead(200, {
14
13
"Content-Type": "text/html",
@@ -13,7 +13,7 @@ const updateChallengeProgressController: RequestHandler = async (req, res) => {
13
13
const accountId = await getAccountIdForRequest(req);
14
14
const inventory = await getInventory(accountId);
15
15
addChallenges(inventory, payload.ChallengeProgress);
16
inventory.save();
16
await inventory.save();
17
17
res.status(200).end();
18
18
};
19
19
@@ -15,7 +15,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
15
15
operation.UpgradeRequirement == "/Lotus/Types/Items/MiscItems/ModSlotUnlocker" ||
16
16
operation.UpgradeRequirement == "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker"
17
17
) {
18
updateCurrency(10, true, accountId);
18
await updateCurrency(10, true, accountId);
19
19
} else {
20
20
addMiscItems(inventory, [
21
21
{
@@ -8,7 +8,7 @@ import allScans from "@/static/fixed_responses/allScans.json";
8
8
9
9
const viewController: RequestHandler = async (req, res) => {
10
10
const accountId = await getAccountIdForRequest(req);
11
const inventory = await Inventory.findOne({ accountOwnerId: req.query.accountId });
11
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
12
12
if (!inventory) {
13
13
res.status(400).json({ error: "inventory was undefined" });
14
14
return;