mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
fix: add prefer-readonly rule (#5122)
This commit is contained in:
@@ -14,7 +14,7 @@ const TrivialExceptions = [NotFoundException];
|
||||
|
||||
@Catch()
|
||||
export class ExceptionLogger implements ExceptionFilter {
|
||||
private logger = new Logger('ExceptionLogger');
|
||||
private readonly logger = new Logger('ExceptionLogger');
|
||||
|
||||
catch(exception: Error, host: ArgumentsHost) {
|
||||
// with useGlobalFilters, the context is always HTTP
|
||||
|
||||
@@ -53,8 +53,8 @@ class AuthGuard implements CanActivate {
|
||||
constructor(
|
||||
@Inject(NextAuthOptionsProvide)
|
||||
private readonly nextAuthOptions: NextAuthOptions,
|
||||
private auth: AuthService,
|
||||
private prisma: PrismaService,
|
||||
private readonly auth: AuthService,
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly reflector: Reflector
|
||||
) {}
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ export const getUtcTimestamp = () => Math.floor(Date.now() / 1000);
|
||||
@Injectable()
|
||||
export class AuthService {
|
||||
constructor(
|
||||
private config: Config,
|
||||
private prisma: PrismaService,
|
||||
private mailer: MailService
|
||||
private readonly config: Config,
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly mailer: MailService
|
||||
) {}
|
||||
|
||||
sign(user: UserClaim) {
|
||||
|
||||
@@ -60,9 +60,9 @@ const MAX_SEQ_NUM = 0x3fffffff; // u31
|
||||
*/
|
||||
@Injectable()
|
||||
export class DocManager implements OnModuleInit, OnModuleDestroy {
|
||||
private logger = new Logger(DocManager.name);
|
||||
private readonly logger = new Logger(DocManager.name);
|
||||
private job: NodeJS.Timeout | null = null;
|
||||
private seqMap = new Map<string, number>();
|
||||
private readonly seqMap = new Map<string, number>();
|
||||
private busy = false;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -16,7 +16,7 @@ export class DocID {
|
||||
raw: string;
|
||||
workspace: string;
|
||||
variant: DocVariant;
|
||||
private sub: string | null;
|
||||
private readonly sub: string | null;
|
||||
|
||||
static parse(raw: string): DocID | null {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user