Skip to content

Commit 2fae7b0

Browse files
committed
chore: update eslint and igrate to pnpm
1 parent 2fdee53 commit 2fae7b0

File tree

12 files changed

+11883
-20
lines changed

12 files changed

+11883
-20
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
extends: [
44
'eslint:recommended',
55
'plugin:@typescript-eslint/recommended',
6-
'prettier/@typescript-eslint',
6+
'prettier',
77
'plugin:prettier/recommended',
88
],
99
plugins: ['@typescript-eslint'],

.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nrwl/nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nrwl/nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nrwl/nx/javascript"],
32+
"rules": {}
33+
}
34+
]
35+
}

apps/http-sample/src/cats/cats.controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
2+
Body,
23
Controller,
4+
Delete,
35
Get,
4-
Post,
5-
Body,
6-
Patch,
76
Param,
8-
Delete,
7+
Patch,
8+
Post,
99
} from '@nestjs/common';
1010
import { CatsService } from './cats.service';
1111
import { CreateCatDto } from './dto/create-cat.dto';

apps/prisma-sample/src/prisma/prisma.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
2+
INestApplication,
23
Injectable,
3-
OnModuleInit,
44
Logger,
5-
INestApplication,
5+
OnModuleInit,
66
} from '@nestjs/common';
77
import { PrismaClient } from '@prisma/client';
88

@@ -36,7 +36,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
3636
}
3737

3838
async truncate() {
39-
let records = await this.$queryRawUnsafe<Array<any>>(`SELECT tablename
39+
const records = await this.$queryRawUnsafe<Array<any>>(`SELECT tablename
4040
FROM pg_tables
4141
WHERE schemaname = 'public'`);
4242
records.forEach((record) => this.truncateTable(record['tablename']));
@@ -56,7 +56,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
5656
}
5757

5858
async resetSequences() {
59-
let results = await this.$queryRawUnsafe<Array<any>>(
59+
const results = await this.$queryRawUnsafe<Array<any>>(
6060
`SELECT c.relname
6161
FROM pg_class AS c
6262
JOIN pg_namespace AS n ON c.relnamespace = n.oid

apps/rxjs-sample/src/rxjs/rxjs.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Logger } from '@nestjs/common';
22
import { Test, TestingModule } from '@nestjs/testing';
33
import { RxjsService } from './rxjs.service';
4-
import { Observer, Observable } from 'rxjs';
4+
import { Observable, Observer } from 'rxjs';
55
import { retryWhen } from 'rxjs/operators';
66

77
const createSource = (retryMax = 2): Observable<any> => {

apps/rxjs-sample/src/rxjs/rxjs.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
export class RxjsService {
1111
constructor(private readonly logger: Logger) {}
1212

13-
genericRetryStrategy<T extends any>(
13+
genericRetryStrategy<T>(
1414
options?: RxJSRetryOptions,
1515
): (obs: Observable<T>) => Observable<number> {
1616
options = { ...defaultRetryOptions, ...options };

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ module.exports = {
1515
tsconfig: '<rootDir>/tsconfig.app.json',
1616
},
1717
},
18+
projects: '<rootDir>/apps/file-up-and-down-sample',
1819
};

jest.preset.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nrwl/jest/preset');
2+
3+
module.exports = { ...nxPreset };

nx.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"defaultBase": "main"
55
},
66
"cli": {
7-
"defaultCollection": "@nrwl/workspace"
7+
"defaultCollection": "@nrwl/nest"
88
},
99
"implicitDependencies": {
1010
"package.json": {
@@ -28,5 +28,6 @@
2828
"projects": "dependencies"
2929
}
3030
]
31-
}
31+
},
32+
"defaultProject": "file-up-and-down-sample"
3233
}

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@
6060
"@nestjs/typeorm": "^8.0.2",
6161
"@nestjs/websockets": "^8.2.4",
6262
"@prisma/client": "^3.8.0",
63+
"@types/validator": "^13.7.1",
6364
"apollo-server-core": "^3.6.1",
6465
"apollo-server-express": "^3.6.1",
6566
"axios": "^0.24.0",
6667
"class-transformer": "^0.5.1",
6768
"class-validator": "^0.13.1",
69+
"express": "^4.17.2",
6870
"graphql": "^15.5.0",
6971
"graphql-tools": "^7.0.4",
7072
"hbs": "^4.1.1",
@@ -78,7 +80,9 @@
7880
"sequelize": "^6.11.0",
7981
"sequelize-typescript": "^2.1.1",
8082
"socket.io-client": "^4.4.0",
81-
"typeorm": "^0.2.31"
83+
"tslib": "^2.0.0",
84+
"typeorm": "^0.2.31",
85+
"webpack": "^5.68.0"
8286
},
8387
"devDependencies": {
8488
"@commitlint/cli": "^12.0.1",
@@ -89,24 +93,25 @@
8993
"@nestjs/schematics": "^8.0.5",
9094
"@nestjs/testing": "^8.2.4",
9195
"@nrwl/cli": "^13.4.4",
96+
"@nrwl/eslint-plugin-nx": "13.7.3",
9297
"@nrwl/jest": "^13.4.4",
98+
"@nrwl/linter": "13.7.3",
9399
"@nrwl/nest": "^13.4.1",
94100
"@nrwl/node": "^13.4.1",
95101
"@nrwl/tao": "^13.4.4",
96102
"@nrwl/workspace": "^13.4.4",
97103
"@types/express": "^4.17.11",
98104
"@types/jest": "^26.0.20",
99105
"@types/node": "^17.0.5",
100-
"@types/redis": "^4.0.11",
101106
"@types/sequelize": "^4.28.11",
102107
"@types/serve-static": "^1.13.9",
103108
"@types/supertest": "^2.0.11",
104109
"@types/uuid": "^8.3.1",
105-
"@typescript-eslint/eslint-plugin": "^4.33.0",
106-
"@typescript-eslint/parser": "^4.31.2",
110+
"@typescript-eslint/eslint-plugin": "^5.10.2",
111+
"@typescript-eslint/parser": "^5.10.2",
107112
"cz-conventional-changelog": "^3.3.0",
108-
"eslint": "^7.21.0",
109-
"eslint-config-prettier": "^8.1.0",
113+
"eslint": "^8",
114+
"eslint-config-prettier": "^8.3.0",
110115
"eslint-plugin-prettier": "^4.0.0",
111116
"husky": "^5.1.3",
112117
"jest": "^26.6.3",

0 commit comments

Comments
 (0)