diff --git a/frontend/README.md b/frontend/README.md index 3ca1d14..71a754f 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -34,7 +34,7 @@ If you are developing a production application, we recommend updating the config "compilerOptions": { "target": "ESNext", "module": "ESNext", - "moduleResolution": "bundler", + "moduleResolution": "node", "jsx": "react-jsx", "strict": true, "noImplicitAny": true, @@ -49,7 +49,6 @@ If you are developing a production application, we recommend updating the config "esModuleInterop": true, "lib": ["ESNext", "DOM", "DOM.Iterable"], "resolveJsonModule": true, - "allowImportingTsExtensions": true, "noEmit": true, "types": ["vite/client"], "typeRoots": ["./@types", "./node_modules/@types"] @@ -60,7 +59,7 @@ If you are developing a production application, we recommend updating the config - **target: "ESNext":** Set the JavaScript language version for the output code to the latest ECMAScript features. - **module: "ESNext":** Use the latest ECMAScript module features like import and export. -- **moduleResolution: "bundler":** Tells TypeScript how to resolve modules, optimized for bundlers like Vite. +- **moduleResolution: "node":** Tells TypeScript to use the latest module system available in JavaScript, which is ECMAScript Modules (ESM). - **jsx: "react-jsx":** Enable the React 17 JSX transform without needing to import React in each JSX file. - **strict: true:** Enables strict type-checking settings for better type safety. - **noImplicitAny: true:** Prevents variables from being implicitly typed as any. @@ -74,7 +73,6 @@ If you are developing a production application, we recommend updating the config - **esModuleInterop: true:** Allows compatibility with CommonJS-style modules. - **lib: ["ESNext", "DOM", "DOM.Iterable"]:** Specifies the libraries to include during compilation, ensuring support for the latest JavaScript and DOM features. - **resolveJsonModule: true:** Allows importing JSON files as modules. -- **allowImportingTsExtensions: true:** Enables importing TypeScript files with .ts and .tsx extensions. - **noEmit: true:** Prevents TypeScript from emitting JavaScript files during compilation, useful when using a bundler. - **types: ["vite/client"]:** Specifies types related to Vite’s client-side environment for better type checking. - **typeRoots: ["./@types", "./node_modules/@types"]:** Defines directories where TypeScript should look for type declarations. diff --git a/frontend/package.json b/frontend/package.json index d90cb00..bbd9b93 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,11 +9,12 @@ "lint": "npx eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "npm run lint --fix", "preview": "vite preview", - "format": "npx prettier . --write", + "format": "npx prettier \"**/*.+(json|ts|tsx)\" --write", "install:packages": "npm i", "upgrade:packages": "npm update --save-dev && npm update --save", "audit": "npm audit --audit-level=high", - "audit:fix": "npm audit fix --force" + "audit:fix": "npm audit fix --force", + "types:check": "tsc --noEmit --pretty" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.7.0", diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 988c444..2e4865f 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", - "moduleResolution": "bundler", + "moduleResolution": "node", "jsx": "react-jsx", "strict": true, "noImplicitAny": true, @@ -17,7 +17,6 @@ "esModuleInterop": true, "lib": ["ESNext", "DOM", "DOM.Iterable"], "resolveJsonModule": true, - "allowImportingTsExtensions": true, "noEmit": true, "types": ["vite/client"], "typeRoots": ["./@types", "./node_modules/@types"]