diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index 95972cca7..2b70c0e78 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -65,7 +65,7 @@ module.exports = { 'import/no-namespace': 'error', 'import/no-unassigned-import': 'error', 'import/order': 'error', - 'import/prefer-default-export': 'off', //TODO + 'import/prefer-default-export': 'off', // TODO }, overrides: [ // only for ts files diff --git a/backend/src/graphql/scalar/Decimal.ts b/backend/src/graphql/scalar/Decimal.ts index 0f259343c..586481a6d 100644 --- a/backend/src/graphql/scalar/Decimal.ts +++ b/backend/src/graphql/scalar/Decimal.ts @@ -1,7 +1,7 @@ import { GraphQLScalarType, Kind } from 'graphql' import { Decimal } from 'decimal.js-light' -export default new GraphQLScalarType({ +const DecimalType = new GraphQLScalarType({ name: 'Decimal', description: 'The `Decimal` scalar type to represent currency values', @@ -21,3 +21,5 @@ export default new GraphQLScalarType({ return new Decimal(ast.value) }, }) + +export default DecimalType diff --git a/backend/src/server/createServer.ts b/backend/src/server/createServer.ts index 5b3be4998..f23e90b56 100644 --- a/backend/src/server/createServer.ts +++ b/backend/src/server/createServer.ts @@ -1,35 +1,20 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ /* eslint-disable @typescript-eslint/unbound-method */ -import 'reflect-metadata' - import { ApolloServer } from 'apollo-server-express' import express, { Express, json, urlencoded } from 'express' - -// database -import connection from '@/typeorm/connection' -import { checkDBVersion } from '@/typeorm/DBVersion' - -// server +import { Connection } from '@dbTools/typeorm' +import { Logger } from 'log4js' import cors from './cors' import serverContext from './context' import plugins from './plugins' - -// config -import CONFIG from '@/config' - -// graphql -import schema from '@/graphql/schema' - -// webhooks -import { elopageWebhook } from '@/webhook/elopage' -import { Connection } from '@dbTools/typeorm' - import { apolloLogger } from './logger' -import { Logger } from 'log4js' - -// i18n import { i18n } from './localization' +import connection from '@/typeorm/connection' +import { checkDBVersion } from '@/typeorm/DBVersion' +import CONFIG from '@/config' +import schema from '@/graphql/schema' +import { elopageWebhook } from '@/webhook/elopage' // TODO implement // import queryComplexity, { simpleEstimator, fieldConfigEstimator } from "graphql-query-complexity"; diff --git a/backend/src/util/decay.test.ts b/backend/src/util/decay.test.ts index d07ee6569..b33d18d42 100644 --- a/backend/src/util/decay.test.ts +++ b/backend/src/util/decay.test.ts @@ -1,5 +1,4 @@ import { Decimal } from 'decimal.js-light' -import 'reflect-metadata' // This might be wise to load in a test setup file import { decayFormula, calculateDecay } from './decay' describe('utils/decay', () => { diff --git a/backend/src/util/klicktipp.ts b/backend/src/util/klicktipp.ts index baa7970fc..6444d20f6 100644 --- a/backend/src/util/klicktipp.ts +++ b/backend/src/util/klicktipp.ts @@ -1,6 +1,6 @@ +import { User } from '@entity/User' import connection from '@/typeorm/connection' import { getKlickTippUser } from '@/apis/KlicktippController' -import { User } from '@entity/User' import LogError from '@/server/LogError' export async function retrieveNotRegisteredEmails(): Promise { diff --git a/backend/src/webhook/elopage.ts b/backend/src/webhook/elopage.ts index 587bb788c..6f3e3cbdb 100644 --- a/backend/src/webhook/elopage.ts +++ b/backend/src/webhook/elopage.ts @@ -32,8 +32,8 @@ */ import { LoginElopageBuys } from '@entity/LoginElopageBuys' -import { UserResolver } from '@/graphql/resolver/UserResolver' import { UserContact as dbUserContact } from '@entity/UserContact' +import { UserResolver } from '@/graphql/resolver/UserResolver' export const elopageWebhook = async (req: any, res: any): Promise => { // eslint-disable-next-line no-console