Skip to content

Commit ad31e69

Browse files
committed
refactor: apply lint and prettier according to upgraded version
1 parent eb1df6a commit ad31e69

6 files changed

Lines changed: 21 additions & 31 deletions

File tree

.prettierrc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
"plugins": ["@trivago/prettier-plugin-sort-imports"],
33
"singleQuote": true,
44
"trailingComma": "all",
5-
"importOrder": ["^@nestjs/(.*)$", "<THIRD_PARTY_MODULES>", "^src/(.*)$", "^[./]"],
5+
"importOrder": [
6+
"^@nestjs/(.*)$",
7+
"<THIRD_PARTY_MODULES>",
8+
"^src/(.*)$",
9+
"^[./]"
10+
],
611
"importOrderSeparation": true,
712
"importOrderSortSpecifiers": true,
8-
"importOrderParserPlugins" : ["typescript", "[\"decorators-legacy\", {\"decoratorsBeforeExport\": true}]"]
9-
}
13+
"importOrderParserPlugins": [
14+
"typescript",
15+
"[\"decorators-legacy\", {\"decoratorsBeforeExport\": true}]"
16+
]
17+
}

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ NestJS boilerplate with TypeORM, GraphQL and PostgreSQL
77
- [1. Open for Contribution](#1-open-for-contribution)
88

99
- [2. Getting Started](#2-getting-started)
10-
1110
- [2.1. Installation](#21-installation)
1211
- [2.2. Run](#22-run)
1312

1413
- [3. Docker](#3-docker)
15-
1614
- [3.1. Docker Compose Installation](#31-docker-compose-installation)
1715
- [3.2. Before Getting Started](#32-before-getting-started)
1816
- [3.3. Run](#33-run)
@@ -24,11 +22,9 @@ NestJS boilerplate with TypeORM, GraphQL and PostgreSQL
2422
- [5. PostgreSQL Database](#5-postgresql-database)
2523

2624
- [6. TypeORM](#6-typeorm)
27-
2825
- [6.1. Migration Setup and Usage](#61-migration-setup-and-usage)
2926

3027
- [7. GraphQL](#7-graphql)
31-
3228
- [7.1. Protected Queries/Mutation By Role](#71-protected-queriesmutation-by-role)
3329
- [7.2. GraphQL Query To Select and Relations](#72-graphql-query-to-select-and-relations)
3430
- [7.3. Field-Level Permission](#73-field-level-permission)
@@ -39,24 +35,20 @@ NestJS boilerplate with TypeORM, GraphQL and PostgreSQL
3935
- [9. Code generator](#9-code-generator)
4036

4137
- [10. Caching](#10-caching)
42-
4338
- [10.1. How To Use](#101-how-to-use)
4439

4540
- [11. TDD](#11-tdd)
46-
4741
- [11.1. Introduction](#111-introduction)
4842
- [11.2. Before Getting Started](#112-before-getting-started)
4943
- [11.3. Unit Test (with mock)](#113-unit-test-with-mock)
5044
- [11.4. Integration Test (with in-memory DB)](#114-integration-test-with-in-memory-db)
5145
- [11.5. End To End Test (with docker)](#115-end-to-end-test-with-docker)
5246

5347
- [12. CI](#12-ci)
54-
5548
- [12.1. Github Actions](#121-github-actions)
5649
- [12.2. Husky v9](#122-husky-v9)
5750

5851
- [13. SWC Compiler](#13-swc-compiler)
59-
6052
- [13.1. SWC + Jest error resolution](#131-swc--jest-error-resolution)
6153

6254
- [14. Todo](#14-todo)
@@ -494,13 +486,11 @@ db.public.registerFunction({
494486
## 14. Todo
495487
496488
- [x] TDD
497-
498489
- [x] Unit Test (Use mock)
499490
- [x] Integration Test (Use in-memory DB)
500491
- [x] End To End Test (Use docker)
501492
502493
- [x] CI
503-
504494
- [x] Github actions
505495
- [x] husky
506496

src/common/config/graphql-config.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import { httpStatusPlugin } from '../exceptions/exception.plugin';
1515
import { EnvironmentVariables } from '../helper/env.validation';
1616

1717
@Injectable()
18-
export class GraphqlConfigService
19-
implements GqlOptionsFactory<ApolloDriverConfig>
20-
{
18+
export class GraphqlConfigService implements GqlOptionsFactory<ApolloDriverConfig> {
2119
constructor(
2220
private readonly configService: ConfigService<EnvironmentVariables>,
2321
) {}

src/common/graphql/utils/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ export interface GetInfoFromQueryProps<Entity> {
111111
select: FindOptionsSelect<Entity>;
112112
}
113113

114-
export interface AddKeyValueInObjectProps<Entity>
115-
extends GetInfoFromQueryProps<Entity> {
114+
export interface AddKeyValueInObjectProps<
115+
Entity,
116+
> extends GetInfoFromQueryProps<Entity> {
116117
stack: string[];
117118
expandRelation?: boolean;
118119
}

src/common/interceptors/repository.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
1212
import { REPOSITORY_INTERCEPTOR } from '../decorators/repository-interceptor.decorator';
1313

1414
@Injectable()
15-
export class QueryIntercepter<T extends ObjectLiteral>
16-
implements NestInterceptor
17-
{
15+
export class QueryIntercepter<
16+
T extends ObjectLiteral,
17+
> implements NestInterceptor {
1818
constructor(private readonly dataSource: DataSource) {}
1919

2020
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown> {

test/jest-e2e.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
{
2-
"moduleFileExtensions": [
3-
"js",
4-
"json",
5-
"ts"
6-
],
2+
"moduleFileExtensions": ["js", "json", "ts"],
73
"rootDir": ".",
84
"testEnvironment": "node",
95
"testRegex": ".e2e-spec.ts$",
106
"transform": {
117
"^.+\\.(t|j)s$": "ts-jest"
128
},
13-
"moduleDirectories": [
14-
"<rootDir>/../",
15-
"node_modules"
16-
]
17-
}
9+
"moduleDirectories": ["<rootDir>/../", "node_modules"]
10+
}

0 commit comments

Comments
 (0)