From 75739355dd95d140fceacf37ea2ab87a01e4d316 Mon Sep 17 00:00:00 2001 From: liuyi Date: Sun, 11 May 2025 15:23:29 +0800 Subject: [PATCH] pnpm lint --- src/app.controller.spec.ts | 27 ++++++++++++++------------- src/app.controller.ts | 11 ++++++----- src/app.module.ts | 7 ++++--- src/main.ts | 5 +++-- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/app.controller.spec.ts b/src/app.controller.spec.ts index d22f389..4964aaf 100644 --- a/src/app.controller.spec.ts +++ b/src/app.controller.spec.ts @@ -1,22 +1,23 @@ import { Test, TestingModule } from '@nestjs/testing'; + import { AppController } from './app.controller'; import { AppService } from './app.service'; describe('AppController', () => { - let appController: AppController; + let appController: AppController; - beforeEach(async () => { - const app: TestingModule = await Test.createTestingModule({ - controllers: [AppController], - providers: [AppService], - }).compile(); + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [AppController], + providers: [AppService], + }).compile(); - appController = app.get(AppController); - }); - - describe('root', () => { - it('should return "Hello World!"', () => { - expect(appController.getHello()).toBe('Hello World!'); + appController = app.get(AppController); + }); + + describe('root', () => { + it('should return "Hello World!"', () => { + expect(appController.getHello()).toBe('Hello World!'); + }); }); - }); }); diff --git a/src/app.controller.ts b/src/app.controller.ts index cce879e..b98b456 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,12 +1,13 @@ import { Controller, Get } from '@nestjs/common'; + import { AppService } from './app.service'; @Controller() export class AppController { - constructor(private readonly appService: AppService) {} + constructor(private readonly appService: AppService) {} - @Get() - getHello(): string { - return this.appService.getHello(); - } + @Get() + getHello(): string { + return this.appService.getHello(); + } } diff --git a/src/app.module.ts b/src/app.module.ts index 8662803..22e614e 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,10 +1,11 @@ import { Module } from '@nestjs/common'; + import { AppController } from './app.controller'; import { AppService } from './app.service'; @Module({ - imports: [], - controllers: [AppController], - providers: [AppService], + imports: [], + controllers: [AppController], + providers: [AppService], }) export class AppModule {} diff --git a/src/main.ts b/src/main.ts index f76bc8d..c38bede 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,9 @@ import { NestFactory } from '@nestjs/core'; + import { AppModule } from './app.module'; async function bootstrap() { - const app = await NestFactory.create(AppModule); - await app.listen(process.env.PORT ?? 3000); + const app = await NestFactory.create(AppModule); + await app.listen(process.env.PORT ?? 3000); } bootstrap();