Skip to content

Commit 1f1347d

Browse files
Merge pull request nestjs#3723 from PaulMest/fix/lint-warnings
fix(sample): Address linter warnings
2 parents c62c3ff + 74c7536 commit 1f1347d

9 files changed

Lines changed: 18 additions & 19 deletions

File tree

sample/05-sql-typeorm/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ services:
99
MYSQL_DATABASE: test
1010
ports:
1111
- "3306:3306"
12-
restart: always

sample/05-sql-typeorm/src/photo/photo.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export class PhotoService {
1111
) {}
1212

1313
async findAll(): Promise<Photo[]> {
14-
return await this.photoRepository.find();
14+
return this.photoRepository.find();
1515
}
1616
}

sample/06-mongoose/src/cats/cats.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export class CatsService {
1010

1111
async create(createCatDto: CreateCatDto): Promise<Cat> {
1212
const createdCat = new this.catModel(createCatDto);
13-
return await createdCat.save();
13+
return createdCat.save();
1414
}
1515

1616
async findAll(): Promise<Cat[]> {
17-
return await this.catModel.find().exec();
17+
return this.catModel.find().exec();
1818
}
1919
}

sample/07-sequelize/src/cats/cats.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export class CatsController {
1414

1515
@Get()
1616
async findAll(): Promise<Cat[]> {
17-
return await this.catsService.findAll();
17+
return this.catsService.findAll();
1818
}
1919
}

sample/07-sequelize/src/cats/cats.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export class CatsService {
1414
cat.breed = createCatDto.breed;
1515
cat.age = createCatDto.age;
1616

17-
return await cat.save();
17+
return cat.save();
1818
}
1919

2020
async findAll(): Promise<Cat[]> {
21-
return await this.catsRepository.findAll<Cat>();
21+
return this.catsRepository.findAll<Cat>();
2222
}
2323
}

sample/12-graphql-apollo/src/cats/cats.resolvers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export class CatsResolvers {
1515
@Query()
1616
@UseGuards(CatsGuard)
1717
async getCats() {
18-
return await this.catsService.findAll();
18+
return this.catsService.findAll();
1919
}
2020

2121
@Query('cat')
2222
async findOneById(
2323
@Args('id', ParseIntPipe)
2424
id: number,
2525
): Promise<Cat> {
26-
return await this.catsService.findOneById(id);
26+
return this.catsService.findOneById(id);
2727
}
2828

2929
@Mutation('createCat')

sample/13-mongo-typeorm/src/photo/photo.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export class PhotoService {
1111
) {}
1212

1313
async findAll(): Promise<Photo[]> {
14-
return await this.photoRepository.find();
14+
return this.photoRepository.find();
1515
}
1616
}

sample/14-mongoose-base/src/cats/cats.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export class CatsService {
99

1010
async create(createCatDto: CreateCatDto): Promise<Cat> {
1111
const createdCat = new this.catModel(createCatDto);
12-
return await createdCat.save();
12+
return createdCat.save();
1313
}
1414

1515
async findAll(): Promise<Cat[]> {
16-
return await this.catModel.find().exec();
16+
return this.catModel.find().exec();
1717
}
1818
}

sample/22-graphql-prisma/src/posts/posts.resolver.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@ export class PostsResolver {
1616

1717
@Query('posts')
1818
async getPosts(@Args() args, @Info() info): Promise<Post[]> {
19-
return await this.prisma.query.posts(args, info);
19+
return this.prisma.query.posts(args, info);
2020
}
2121

2222
@Query('post')
2323
async getPost(@Args() args, @Info() info): Promise<Post> {
24-
return await this.prisma.query.post(args, info);
24+
return this.prisma.query.post(args, info);
2525
}
2626

2727
@Mutation('createPost')
2828
async createPost(@Args() args, @Info() info): Promise<Post> {
29-
return await this.prisma.mutation.createPost(args, info);
29+
return this.prisma.mutation.createPost(args, info);
3030
}
3131

3232
@Mutation('updatePost')
3333
async updatePost(@Args() args, @Info() info): Promise<Post> {
34-
return await this.prisma.mutation.updatePost(args, info);
34+
return this.prisma.mutation.updatePost(args, info);
3535
}
3636

3737
@Mutation('updateManyPosts')
3838
async updateManyPosts(@Args() args, @Info() info): Promise<BatchPayload> {
39-
return await this.prisma.mutation.updateManyPosts(args, info);
39+
return this.prisma.mutation.updateManyPosts(args, info);
4040
}
4141

4242
@Mutation('deletePost')
4343
async deletePost(@Args() args, @Info() info): Promise<Post> {
44-
return await this.prisma.mutation.deletePost(args, info);
44+
return this.prisma.mutation.deletePost(args, info);
4545
}
4646

4747
@Mutation('deleteManyPosts')
4848
async deleteManyPosts(@Args() args, @Info() info): Promise<BatchPayload> {
49-
return await this.prisma.mutation.deleteManyPosts(args, info);
49+
return this.prisma.mutation.deleteManyPosts(args, info);
5050
}
5151

5252
@Subscription('post')

0 commit comments

Comments
 (0)