fixed duplicate imports

This commit is contained in:
Miodec 2022-09-27 15:49:32 +02:00
parent 2264af3c70
commit a9f1580aab
7 changed files with 19 additions and 10 deletions

View file

@ -36,7 +36,6 @@ import { getDailyLeaderboard } from "../../utils/daily-leaderboards";
import AutoRoleList from "../../constants/auto-roles";
import * as UserDAL from "../../dal/user";
import { buildMonkeyMail } from "../../utils/monkey-mail";
import { updateStreak } from "../../dal/user";
try {
if (anticheatImplemented() === false) throw new Error("undefined");
@ -371,7 +370,7 @@ export async function addResult(
);
}
const streak = await updateStreak(uid, result.timestamp);
const streak = await UserDAL.updateStreak(uid, result.timestamp);
const xpGained = await calculateXp(
result,

View file

@ -2,7 +2,6 @@ import _ from "lodash";
import psas from "./psas";
import users from "./users";
import { join } from "path";
import express from "express";
import quotes from "./quotes";
import configs from "./configs";
import results from "./results";
@ -15,7 +14,13 @@ import addSwaggerMiddlewares from "./swagger";
import { asyncHandler } from "../../middlewares/api-utils";
import { MonkeyResponse } from "../../utils/monkey-response";
import { recordClientVersion } from "../../utils/prometheus";
import { Application, NextFunction, Response, Router } from "express";
import {
Application,
NextFunction,
Response,
Router,
static as expressStatic,
} from "express";
const pathOverride = process.env.API_PATH_OVERRIDE;
const BASE_ROUTE = pathOverride ? `/${pathOverride}` : "";
@ -41,7 +46,7 @@ function addApiRoutes(app: Application): void {
app.use("/configuration", configuration);
if (process.env.MODE === "dev") {
app.use("/configure", express.static(join(__dirname, "../../../private")));
app.use("/configure", expressStatic(join(__dirname, "../../../private")));
}
addSwaggerMiddlewares(app);

View file

@ -1,5 +1,9 @@
import { Analytics as AnalyticsType, getAnalytics } from "firebase/analytics";
import { logEvent, setAnalyticsCollectionEnabled } from "firebase/analytics";
import {
Analytics as AnalyticsType,
getAnalytics,
logEvent,
setAnalyticsCollectionEnabled,
} from "firebase/analytics";
import { app as firebaseApp } from "../firebase";
export let Analytics: AnalyticsType;

View file

@ -48,6 +48,7 @@ import * as ConfigEvent from "../observables/config-event";
import format from "date-fns/format";
import "chartjs-adapter-date-fns";
// eslint-disable-next-line no-duplicate-imports -- need to ignore because eslint doesnt know what import type is
import type {
AnimationSpec,
CartesianScaleOptions,
@ -59,6 +60,7 @@ import type {
ScaleChartOptions,
} from "chart.js";
// eslint-disable-next-line no-duplicate-imports -- need to ignore because eslint doesnt know what import type is
import type {
AnnotationOptions,
LabelOptions,

View file

@ -18,7 +18,6 @@ import "./test/caps-warning";
import "./popups/support-popup";
import "./popups/contact-popup";
import "./popups/version-popup";
import "./popups/video-ad-popup";
import "./popups/edit-preset-popup";
import "./popups/simple-popups";
import "./controllers/input-controller";

View file

@ -1,6 +1,5 @@
import * as TestLogic from "../test/test-logic";
import Config from "../config";
import * as UpdateConfig from "../config";
import Config, * as UpdateConfig from "../config";
import * as ManualRestart from "../test/manual-restart-tracker";
import * as CustomWordAmountPopup from "./custom-word-amount-popup";
import * as CustomTestDurationPopup from "./custom-test-duration-popup";

View file

@ -19,6 +19,7 @@ import * as TestConfig from "./test-config";
import { Chart } from "chart.js";
import { Auth } from "../firebase";
// eslint-disable-next-line no-duplicate-imports -- need to ignore because eslint doesnt know what import type is
import type { PluginChartOptions, ScaleChartOptions } from "chart.js";
import type { AnnotationOptions } from "chartjs-plugin-annotation";
import Ape from "../ape";