Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

lint:fix

Blue Mousef4312c5518c4
diff --git a/apps/production/src/analytics/analytics.controller.ts b/apps/production/src/analytics/analytics.controller.ts
index 2b087d16d..6d3b2c24d 100644
--- a/apps/production/src/analytics/analytics.controller.ts
+++ b/apps/production/src/analytics/analytics.controller.ts
@@ -842,7 +842,6 @@ export class AnalyticsController {
try {
const values = `(${dto.map(getElValue).join(',')})`
await redis.rpush(REDIS_LOG_CUSTOM_CACHE_KEY, values)
- return
} catch (e) {
this.logger.error(e)
throw new InternalServerErrorException(
@@ -976,8 +975,6 @@ export class AnalyticsController {
if (!_isEmpty(perfDTO)) {
await redis.rpush(REDIS_LOG_PERF_CACHE_KEY, perfValues)
}
-
- return
} catch (e) {
this.logger.error(e)
throw new InternalServerErrorException(
diff --git a/apps/production/src/project/project.controller.ts b/apps/production/src/project/project.controller.ts
index af6024775..23ca1fd92 100644
--- a/apps/production/src/project/project.controller.ts
+++ b/apps/production/src/project/project.controller.ts
@@ -29,10 +29,10 @@ import * as _head from 'lodash/head'
import * as _filter from 'lodash/filter'
import * as dayjs from 'dayjs'
+import { hash } from 'bcrypt'
import { JwtAccessTokenGuard } from '../auth/guards'
import { Auth, Public } from '../auth/decorators'
import { isValidDate } from '../analytics/analytics.service'
-import { hash } from 'bcrypt'
import {
ProjectService,
processProjectUser,
@@ -335,6 +335,7 @@ export class ProjectController {
let pid = generateProjectId()
+ // eslint-disable-next-line no-await-in-loop
while (!(await this.projectService.isPIDUnique(pid))) {
pid = generateProjectId()
}
diff --git a/apps/production/src/project/project.service.ts b/apps/production/src/project/project.service.ts
index 35b401856..01846b05c 100644
--- a/apps/production/src/project/project.service.ts
+++ b/apps/production/src/project/project.service.ts
@@ -52,13 +52,18 @@ import {
import { IUsageInfoRedis } from '../user/interfaces'
import { ProjectSubscriber } from './entity'
import { AddSubscriberType } from './types'
-import { CreateProjectDTO, GetSubscribersQueriesDto, UpdateSubscriberBodyDto } from './dto'
+import {
+ CreateProjectDTO,
+ GetSubscribersQueriesDto,
+ UpdateSubscriberBodyDto,
+} from './dto'
import { ReportFrequency } from './enums'
dayjs.extend(utc)
// A list of characters that can be used in a Project ID
-const LEGAL_PID_CHARACTERS = '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
+const LEGAL_PID_CHARACTERS =
+ '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
export const generateProjectId = customAlphabet(LEGAL_PID_CHARACTERS, 12)
// const updateProjectRedis = async (id: string, project: Project) => {
diff --git a/apps/selfhosted/src/analytics/analytics.controller.ts b/apps/selfhosted/src/analytics/analytics.controller.ts
index dd9b7ebb5..5220adddf 100644
--- a/apps/selfhosted/src/analytics/analytics.controller.ts
+++ b/apps/selfhosted/src/analytics/analytics.controller.ts
@@ -769,7 +769,6 @@ export class AnalyticsController {
try {
const values = `(${dto.map(getElValue).join(',')})`
await redis.rpush(REDIS_LOG_CUSTOM_CACHE_KEY, values)
- return
} catch (e) {
this.logger.error(e)
throw new InternalServerErrorException(
@@ -903,8 +902,6 @@ export class AnalyticsController {
if (!_isEmpty(perfDTO)) {
await redis.rpush(REDIS_LOG_PERF_CACHE_KEY, perfValues)
}
-
- return
} catch (e) {
this.logger.error(e)
throw new InternalServerErrorException(
diff --git a/apps/selfhosted/src/project/project.controller.ts b/apps/selfhosted/src/project/project.controller.ts
index 03f26fa12..09ed8d2d5 100644
--- a/apps/selfhosted/src/project/project.controller.ts
+++ b/apps/selfhosted/src/project/project.controller.ts
@@ -25,7 +25,9 @@ import { JwtAccessTokenGuard } from '../auth/guards'
import { Auth } from '../auth/decorators'
import { isValidDate } from '../analytics/analytics.service'
import {
- ProjectService, deleteProjectRedis, generateProjectId,
+ ProjectService,
+ deleteProjectRedis,
+ generateProjectId,
} from './project.service'
import { UserType } from '../user/entities/user.entity'
import { Roles } from '../auth/decorators/roles.decorator'
@@ -33,9 +35,7 @@ import { RolesGuard } from '../auth/guards/roles.guard'
import { Pagination } from '../common/pagination/pagination'
import { Project } from './entity/project.entity'
import { CurrentUserId } from '../auth/decorators/current-user-id.decorator'
-import {
- ProjectDTO, CreateProjectDTO,
-} from './dto'
+import { ProjectDTO, CreateProjectDTO } from './dto'
import { AppLoggerService } from '../logger/logger.service'
import { isValidPID, clickhouse } from '../common/constants'
import {
@@ -104,7 +104,7 @@ export class ProjectController {
let pid = generateProjectId()
- while (!(this.projectService.isPIDUnique(projects, pid))) {
+ while (!this.projectService.isPIDUnique(projects, pid)) {
pid = generateProjectId()
}
diff --git a/apps/selfhosted/src/project/project.service.ts b/apps/selfhosted/src/project/project.service.ts
index f1d543ee3..31cb744ac 100644
--- a/apps/selfhosted/src/project/project.service.ts
+++ b/apps/selfhosted/src/project/project.service.ts
@@ -34,7 +34,8 @@ import { getProjectsClickhouse } from '../common/utils'
import { CreateProjectDTO } from './dto'
// A list of characters that can be used in a Project ID
-const LEGAL_PID_CHARACTERS = '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
+const LEGAL_PID_CHARACTERS =
+ '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
export const generateProjectId = customAlphabet(LEGAL_PID_CHARACTERS, 12)
export const deleteProjectRedis = async (id: string) => {