> For the complete documentation index, see [llms.txt](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/introduction/upgrading-packages-ncu/nestjs-v10-greater-than-v11.md).

# NestJS v10 -> v11

To upgrade Nest from v10 to v11, please refer to the previous document for the basic part, related to updating **Node** and **Nest**, and installing/executing **ncu**. In this case, update everything.

The steps specific to this version update are as follows:

* Add the following dependencies:

```sh
yarn add -D @eslint/eslintrc @eslint/js @swc/cli @swc/core globals typescript-eslint
```

* Remove the following ones:

```sh
yarn remove @typescript-eslint/eslint-plugin @typescript-eslint/parser
```

* In <mark style="color:purple;">tsconfig.json</mark>, enable the following options:
  * <mark style="color:blue;">`strictNullChecks`</mark>
  * <mark style="color:blue;">`forceConsistentCasingInFileNames`</mark>
* The **ESLint** file is now <mark style="color:purple;">eslint.config.mjs</mark>, and has the following base template:

```javascript
// @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': 'warn',
      '@typescript-eslint/no-unsafe-argument': 'warn'
    },
  },
);
```

* In the e2e test file, use <mark style="color:blue;">`App`</mark> as type parameter for <mark style="color:blue;">`app`</mark> and as type for <mark style="color:blue;">`server`</mark>
* In the <mark style="color:purple;">main</mark> file, prefix the <mark style="color:blue;">`bootstrap()`</mark> call with <mark style="color:blue;">void</mark> to explicitly <mark style="color:red;">not</mark> await it

With this, the project is updated. However, I'll make some more changes related to type safety strictness, as to make it more flexible:

* In <mark style="color:purple;">tsconfig.json</mark>, disable <mark style="color:blue;">`strictNullChecks`</mark>
* In <mark style="color:purple;">esling.config.mjs</mark>, in <mark style="color:blue;">`rules`</mark>, disable the following options (mainly related to <mark style="color:red;">any</mark> handling):

```javascript
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'no-case-declarations': 'off',
```

{% hint style="info" %}
This prevents errors in several parts of the system.
{% endhint %}

<mark style="color:green;">**Commit**</mark> - Upgrading from NestJS v10 to v11
