Skip to content

Commit 64847d4

Browse files
committed
lint
1 parent f61524b commit 64847d4

File tree

193 files changed

+2376
-2386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+2376
-2386
lines changed

apps/backend/scripts/build.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const writeSoundList = async () => {
88
function writeJSONFile(
99
dir: string,
1010
fileName: string,
11-
data: Record<string, any> | string[],
11+
data: Record<string, any> | string[]
1212
) {
1313
const path = resolve(dir, fileName);
1414
const jsonString = JSON.stringify(data, null, 0);
@@ -56,24 +56,24 @@ const build = async () => {
5656
'class-validator',
5757
'@nestjs/microservices',
5858
'@nestjs/websockets',
59-
'@fastify/static',
59+
'@fastify/static'
6060
];
6161

6262
const result = await Bun.build({
6363
entrypoints: ['./src/main.ts'],
64-
outdir: './dist',
65-
target: 'bun',
66-
minify: false,
67-
sourcemap: 'linked',
68-
external: optionalRequirePackages.filter((pkg) => {
64+
outdir : './dist',
65+
target : 'bun',
66+
minify : false,
67+
sourcemap : 'linked',
68+
external : optionalRequirePackages.filter((pkg) => {
6969
try {
7070
require(pkg);
7171
return false;
7272
} catch (_) {
7373
return true;
7474
}
7575
}),
76-
splitting: true,
76+
splitting: true
7777
});
7878

7979
if (!result.success) {

apps/backend/src/app.module.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,57 +20,57 @@ import { UserModule } from './user/user.module';
2020
@Module({
2121
imports: [
2222
ConfigModule.forRoot({
23-
isGlobal: true,
23+
isGlobal : true,
2424
envFilePath: ['.env.development', '.env.production'],
25-
validate,
25+
validate
2626
}),
2727
//DatabaseModule,
2828
MongooseModule.forRootAsync({
29-
imports: [ConfigModule],
30-
inject: [ConfigService],
29+
imports : [ConfigModule],
30+
inject : [ConfigService],
3131
useFactory: (
32-
configService: ConfigService,
32+
configService: ConfigService
3333
): MongooseModuleFactoryOptions => {
3434
const url = configService.getOrThrow<string>('MONGO_URL');
3535
Logger.debug(`Connecting to ${url}`);
3636

3737
return {
38-
uri: url,
38+
uri : url,
3939
retryAttempts: 10,
40-
retryDelay: 3000,
40+
retryDelay : 3000
4141
};
42-
},
42+
}
4343
}),
4444
// Mailing
4545
MailerModule.forRootAsync({
46-
imports: [ConfigModule],
46+
imports : [ConfigModule],
4747
useFactory: (configService: ConfigService) => {
4848
const transport = configService.getOrThrow<string>('MAIL_TRANSPORT');
4949
const from = configService.getOrThrow<string>('MAIL_FROM');
5050
AppModule.logger.debug(`MAIL_TRANSPORT: ${transport}`);
5151
AppModule.logger.debug(`MAIL_FROM: ${from}`);
5252
return {
5353
transport: transport,
54-
defaults: {
55-
from: from,
54+
defaults : {
55+
from: from
5656
},
5757
template: {
58-
dir: __dirname + '/mailing/templates',
58+
dir : __dirname + '/mailing/templates',
5959
adapter: new HandlebarsAdapter(),
6060
options: {
61-
strict: true,
62-
},
63-
},
61+
strict: true
62+
}
63+
}
6464
};
6565
},
66-
inject: [ConfigService],
66+
inject: [ConfigService]
6767
}),
6868
// Throttler
6969
ThrottlerModule.forRoot([
7070
{
71-
ttl: 60,
72-
limit: 256, // 256 requests per minute
73-
},
71+
ttl : 60,
72+
limit: 256 // 256 requests per minute
73+
}
7474
]),
7575
SongModule,
7676
UserModule,
@@ -79,17 +79,17 @@ import { UserModule } from './user/user.module';
7979
SongBrowserModule,
8080
SeedModule.forRoot(),
8181
EmailLoginModule,
82-
MailingModule,
82+
MailingModule
8383
],
8484
controllers: [],
85-
providers: [
85+
providers : [
8686
ParseTokenPipe,
8787
{
88-
provide: APP_GUARD,
89-
useClass: ThrottlerGuard,
90-
},
88+
provide : APP_GUARD,
89+
useClass: ThrottlerGuard
90+
}
9191
],
92-
exports: [ParseTokenPipe],
92+
exports: [ParseTokenPipe]
9393
})
9494
export class AppModule {
9595
static readonly logger = new Logger(AppModule.name);

apps/backend/src/auth/auth.controller.spec.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { AuthService } from './auth.service';
66
import { MagicLinkEmailStrategy } from './strategies/magicLinkEmail.strategy';
77

88
const mockAuthService = {
9-
githubLogin: jest.fn(),
10-
googleLogin: jest.fn(),
11-
discordLogin: jest.fn(),
12-
verifyToken: jest.fn(),
13-
loginWithEmail: jest.fn(),
9+
githubLogin : jest.fn(),
10+
googleLogin : jest.fn(),
11+
discordLogin : jest.fn(),
12+
verifyToken : jest.fn(),
13+
loginWithEmail: jest.fn()
1414
};
1515

1616
const mockMagicLinkEmailStrategy = {
17-
send: jest.fn(),
17+
send: jest.fn()
1818
};
1919

2020
describe('AuthController', () => {
@@ -24,16 +24,16 @@ describe('AuthController', () => {
2424
beforeEach(async () => {
2525
const module: TestingModule = await Test.createTestingModule({
2626
controllers: [AuthController],
27-
providers: [
27+
providers : [
2828
{
29-
provide: AuthService,
30-
useValue: mockAuthService,
29+
provide : AuthService,
30+
useValue: mockAuthService
3131
},
3232
{
33-
provide: MagicLinkEmailStrategy,
34-
useValue: mockMagicLinkEmailStrategy,
35-
},
36-
],
33+
provide : MagicLinkEmailStrategy,
34+
useValue: mockMagicLinkEmailStrategy
35+
}
36+
]
3737
}).compile();
3838

3939
controller = module.get<AuthController>(AuthController);
@@ -61,7 +61,7 @@ describe('AuthController', () => {
6161
(authService.githubLogin as jest.Mock).mockRejectedValueOnce(error);
6262

6363
await expect(controller.githubRedirect(req, res)).rejects.toThrow(
64-
'Test error',
64+
'Test error'
6565
);
6666
});
6767
});
@@ -90,7 +90,7 @@ describe('AuthController', () => {
9090
(authService.googleLogin as jest.Mock).mockRejectedValueOnce(error);
9191

9292
await expect(controller.googleRedirect(req, res)).rejects.toThrow(
93-
'Test error',
93+
'Test error'
9494
);
9595
});
9696
});
@@ -119,7 +119,7 @@ describe('AuthController', () => {
119119
(authService.discordLogin as jest.Mock).mockRejectedValueOnce(error);
120120

121121
await expect(controller.discordRedirect(req, res)).rejects.toThrow(
122-
'Test error',
122+
'Test error'
123123
);
124124
});
125125
});
@@ -148,7 +148,7 @@ describe('AuthController', () => {
148148
(authService.loginWithEmail as jest.Mock).mockRejectedValueOnce(error);
149149

150150
await expect(controller.magicLinkRedirect(req, res)).rejects.toThrow(
151-
'Test error',
151+
'Test error'
152152
);
153153
});
154154
});

apps/backend/src/auth/auth.controller.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Post,
99
Req,
1010
Res,
11-
UseGuards,
11+
UseGuards
1212
} from '@nestjs/common';
1313
import { AuthGuard } from '@nestjs/passport';
1414
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
@@ -26,15 +26,15 @@ export class AuthController {
2626
@Inject(AuthService)
2727
private readonly authService: AuthService,
2828
@Inject(MagicLinkEmailStrategy)
29-
private readonly magicLinkEmailStrategy: MagicLinkEmailStrategy,
29+
private readonly magicLinkEmailStrategy: MagicLinkEmailStrategy
3030
) {}
3131

3232
@Throttle({
3333
default: {
3434
// one every 1 hour
35-
ttl: 60 * 60 * 1000,
36-
limit: 1,
37-
},
35+
ttl : 60 * 60 * 1000,
36+
limit: 1
37+
}
3838
})
3939
@Post('login/magic-link')
4040
@ApiOperation({
@@ -44,21 +44,21 @@ export class AuthController {
4444
content: {
4545
'application/json': {
4646
schema: {
47-
type: 'object',
47+
type : 'object',
4848
properties: {
4949
destination: {
50-
type: 'string',
51-
example: '[email protected]',
52-
description: 'Email address to send the magic link to',
53-
},
50+
type : 'string',
51+
example : '[email protected]',
52+
description: 'Email address to send the magic link to'
53+
}
5454
},
55-
required: ['destination'],
56-
},
57-
},
58-
},
59-
},
55+
required: ['destination']
56+
}
57+
}
58+
}
59+
}
6060
})
61-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
61+
6262
public async magicLinkLogin(@Req() req: Request, @Res() res: Response) {
6363
throw new HttpException('Not implemented', HttpStatus.NOT_IMPLEMENTED);
6464
// TODO: uncomment this line to enable magic link login
@@ -67,7 +67,7 @@ export class AuthController {
6767

6868
@Get('magic-link/callback')
6969
@ApiOperation({
70-
summary: 'Will send the user a email with a single use login link',
70+
summary: 'Will send the user a email with a single use login link'
7171
})
7272
@UseGuards(AuthGuard('magic-link'))
7373
public async magicLinkRedirect(@Req() req: Request, @Res() res: Response) {
@@ -127,9 +127,9 @@ export class AuthController {
127127
public verify(
128128
@Req() req: Request,
129129
@Res({
130-
passthrough: true,
130+
passthrough: true
131131
})
132-
res: Response,
132+
res: Response
133133
) {
134134
this.authService.verifyToken(req, res);
135135
}

0 commit comments

Comments
 (0)