From 0a5b9928c001e9a6d083b7cdf2c939a8bcc78393 Mon Sep 17 00:00:00 2001
From: Dysk0 <javiroldan98@gmail.com>
Date: Tue, 16 Apr 2024 01:34:06 +0200
Subject: [PATCH] tsconfig.json file edit

---
 tsconfig.json | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/tsconfig.json b/tsconfig.json
index e075f97..10d9c8b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -24,8 +24,20 @@
     // "useDefineForClassFields": true,                  /* Emit ECMAScript-standard-compliant class fields. */
     // "moduleDetection": "auto",                        /* Control what method is used to detect module-format JS files. */
 
+    // This is a list of library files to be included in the compilation.
+    "lib": [
+      "dom",
+      "dom.iterable",
+      "esnext"
+    ],
+
+    // Set to true because Next.js handles the compilation of TypeScript files, so you don’t want TypeScript to output files during the build process.
+    "noEmit": true,
+
     /* Modules */
-    "module": "commonjs",                                /* Specify what module code is generated. */
+
+    // Next.js prefers esnext modules, which supports dynamic imports, and node resolution strategy for working with npm packages and node internals.
+    "module": "esnext",                                  /* Specify what module code is generated. */
     // "rootDir": "./",                                  /* Specify the root folder within your source files. */
     // "moduleResolution": "node10",                     /* Specify how TypeScript looks up a file from a given module specifier. */
     // "baseUrl": "./",                                  /* Specify the base directory to resolve non-relative module names. */
@@ -43,6 +55,8 @@
     // "allowArbitraryExtensions": true,                 /* Enable importing files with any extension, provided a declaration file is present. */
     // "noResolve": true,                                /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
 
+    "moduleResolution": "node",
+
     /* JavaScript Support */
     // "allowJs": true,                                  /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
     // "checkJs": true,                                  /* Enable error reporting in type-checked JavaScript files. */
@@ -73,6 +87,15 @@
     // "declarationDir": "./",                           /* Specify the output directory for generated declaration files. */
     // "preserveValueImports": true,                     /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
 
+    "jsx": "preserve",
+    "incremental": true,
+    "removeComments": false,
+    "baseUrl": ".",
+    "paths": {
+      "@/components/*": ["components/*"],
+      "@/lib/*": ["lib/*"]
+    }
+
     /* Interop Constraints */
     // "isolatedModules": true,                          /* Ensure that each file can be safely transpiled without relying on other imports. */
     // "verbatimModuleSyntax": true,                     /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
@@ -105,5 +128,13 @@
     /* Completeness */
     // "skipDefaultLibCheck": true,                      /* Skip type checking .d.ts files that are included with TypeScript. */
     "skipLibCheck": true                                 /* Skip type checking all .d.ts files. */
-  }
+  },
+  "include": [
+    "next-env.d.ts",
+    "**/*.ts",
+    "**/*.tsx"
+  ],
+  "exclude": [
+    "node_modules"
+  ]
 }
-- 
GitLab