From 780fe91c294e234bad98b7e50bdde098335b7a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Thu, 16 Jan 2025 11:26:10 +0100 Subject: [PATCH] sample: another round of sample updates --- sample/10-fastify/.eslintrc.js | 23 ---------------- sample/10-fastify/eslint.config.mjs | 42 +++++++++++++++++++++++++++++ sample/10-fastify/package.json | 23 ++++++++-------- 3 files changed, 54 insertions(+), 34 deletions(-) delete mode 100644 sample/10-fastify/.eslintrc.js create mode 100644 sample/10-fastify/eslint.config.mjs diff --git a/sample/10-fastify/.eslintrc.js b/sample/10-fastify/.eslintrc.js deleted file mode 100644 index 284719548..000000000 --- a/sample/10-fastify/.eslintrc.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module', - }, - plugins: ['@typescript-eslint/eslint-plugin'], - extends: [ - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - ], - root: true, - env: { - node: true, - jest: true, - }, - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/no-explicit-any': 'off', - }, -}; diff --git a/sample/10-fastify/eslint.config.mjs b/sample/10-fastify/eslint.config.mjs new file mode 100644 index 000000000..ba1c71128 --- /dev/null +++ b/sample/10-fastify/eslint.config.mjs @@ -0,0 +1,42 @@ +// @ts-check +import eslint from '@eslint/js'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { + ignores: ['eslint.config.mjs'], + }, + eslint.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + eslintPluginPrettierRecommended, + { + languageOptions: { + globals: { + ...globals.node, + ...globals.jest, + }, + ecmaVersion: 5, + sourceType: 'module', + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + }, + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/require-await': 'warn', + '@typescript-eslint/no-unused-vars': 'warn', + }, + }, +); \ No newline at end of file diff --git a/sample/10-fastify/package.json b/sample/10-fastify/package.json index ef36bba58..cc1e253b8 100644 --- a/sample/10-fastify/package.json +++ b/sample/10-fastify/package.json @@ -19,9 +19,9 @@ "test:e2e": "echo 'No e2e tests implemented yet.'" }, "dependencies": { - "@nestjs/common": "10.4.15", - "@nestjs/core": "10.4.15", - "@nestjs/platform-fastify": "10.4.15", + "@nestjs/common": "11.0.0", + "@nestjs/core": "11.0.0", + "@nestjs/platform-fastify": "11.0.0", "class-transformer": "0.5.1", "class-validator": "0.14.1", "reflect-metadata": "0.2.2", @@ -29,17 +29,17 @@ "rxjs": "7.8.1" }, "devDependencies": { + "@eslint/eslintrc": "3.2.0", + "@eslint/js": "9.18.0", "@nestjs/cli": "10.4.9", "@nestjs/schematics": "10.2.3", - "@nestjs/testing": "10.4.15", - "@types/express": "4.17.21", - "@types/node": "22.10.6", + "@nestjs/testing": "11.0.0", + "@types/express": "5.0.0", + "@types/node": "22.10.7", "@types/supertest": "6.0.2", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", "eslint": "9.18.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.31.0", + "eslint-plugin-prettier": "5.2.2", + "globals": "15.14.0", "jest": "29.7.0", "prettier": "3.4.2", "supertest": "7.0.0", @@ -47,6 +47,7 @@ "ts-loader": "9.5.2", "ts-node": "10.9.2", "tsconfig-paths": "4.2.0", - "typescript": "5.7.3" + "typescript": "5.7.3", + "typescript-eslint": "8.20.0" } }