Skip to content

Commit 6f5557f

Browse files
authored
feat: upgrade NestJS to v11 and migrate to ESLint flat config (#10746)
### Description <!-- ✍️ Write a short summary of your work. If necessary, include relevant screenshots. --> This PR upgrades the NestJS example from v10 to v11 and modernizes the project configuration. The main changes include: - **NestJS Upgrade**: Upgrade `@nestjs/common`, `@nestjs/core`, and `@nestjs/platform-express` from v10 to v11 - **ESLint Migration**: Migrate from legacy `.eslintrc.js` format to modern flat config format using `eslint.config.mjs` - **Configuration Cleanup**: Remove legacy configuration files (`.eslintrc.js`, `.prettierrc.js`) and replace with modern equivalents - **Package Updates**: Update dependencies and scripts across all packages in the monorepo - **Project Structure**: Modernize the overall project structure with updated TypeScript and build configurations <!-- Give a quick description of steps to test your changes. --> ## Testing Instructions 1. **Install Dependencies** ```bash pnpm install pnpm build ``` 2. **Verify NestJS API** ```bash pnpm --filter=api run dev ``` - Check that the API starts without errors - Verify endpoints are accessible at `http://localhost:3000` 3. **Test Web Application** ```bash pnpm --filter=web run dev ``` - Ensure the web app runs on `http://localhost:3001` - Verify the UI displays correctly 4. **Linting and Formatting** ```bash pnpm run lint pnpm run format ``` - Confirm ESLint runs without errors - Verify Prettier formatting works correctly 5. **Build Process** ```bash pnpm build ``` - Ensure all packages build successfully - Check for any TypeScript compilation errors 6. **Run Tests** ```bash pnpm test ``` - Verify all tests pass - Check that Jest configuration works properly
1 parent e34dcd4 commit 6f5557f

Some content is hidden

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

72 files changed

+3079
-4921
lines changed

examples/with-nestjs/.eslintrc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/with-nestjs/.eslintrc.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { libraryConfig } from "@repo/eslint-config/library";
2+
import tsParser from "@typescript-eslint/parser";
3+
4+
export default [
5+
{
6+
ignores: ["apps/**", "packages/**", "dist/**", "node_modules/**"],
7+
},
8+
...libraryConfig,
9+
{
10+
parser: tsParser,
11+
parserOptions: {
12+
project: true,
13+
},
14+
},
15+
{
16+
rules: {
17+
// add override for any (a metric ton of them, initial conversion)
18+
"@typescript-eslint/no-explicit-any": "off",
19+
// we generally use this in isFunction, not via calling
20+
"@typescript-eslint/unbound-method": "off",
21+
},
22+
},
23+
];

examples/with-nestjs/.prettierrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import config from "@repo/eslint-config/prettier-base";
2+
3+
/** @type {import("prettier").Config} */
4+
export default config;

examples/with-nestjs/apps/api/.eslintrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/with-nestjs/apps/api/.prettierrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import config from "@repo/eslint-config/prettier-base";
2+
3+
/** @type {import("prettier").Config} */
4+
export default config;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { nestJsConfig } from "@repo/eslint-config/nest-js";
2+
3+
/** @type {import("eslint").Linter.Config} */
4+
export default nestJsConfig;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { config } from '@repo/jest-config/nest';
1+
import { nestConfig } from '@repo/jest-config';
22

3-
export default config;
3+
export default nestConfig;

examples/with-nestjs/apps/api/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@
1515
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
1616
},
1717
"dependencies": {
18-
"@nestjs/common": "^10.0.0",
19-
"@nestjs/core": "^10.0.0",
20-
"@nestjs/platform-express": "^10.0.0",
18+
"@nestjs/common": "^11.0.0",
19+
"@nestjs/core": "^11.0.0",
20+
"@nestjs/platform-express": "^11.0.0",
2121
"@repo/api": "workspace:*",
2222
"reflect-metadata": "^0.2.0",
2323
"rxjs": "^7.8.1"
2424
},
2525
"devDependencies": {
2626
"@jest/globals": "^29.7.0",
27-
"@nestjs/cli": "^10.0.0",
28-
"@nestjs/schematics": "^10.0.0",
29-
"@nestjs/testing": "^10.0.0",
27+
"@nestjs/cli": "^11.0.0",
28+
"@nestjs/schematics": "^11.0.0",
29+
"@nestjs/testing": "^11.0.0",
3030
"@repo/eslint-config": "workspace:*",
3131
"@repo/jest-config": "workspace:*",
3232
"@repo/typescript-config": "workspace:*",
3333
"@types/express": "^4.17.17",
34-
"@types/node": "^20.3.1",
34+
"@types/node": "^22.10.7",
3535
"@types/supertest": "^6.0.0",
3636
"jest": "^29.7.0",
3737
"source-map-support": "^0.5.21",
38-
"supertest": "^6.3.3",
38+
"supertest": "^7.0.0",
3939
"ts-jest": "^29.2.5",
4040
"ts-loader": "^9.4.3",
4141
"ts-node": "^10.9.2",

0 commit comments

Comments
 (0)