From 33bb94e38ab34634a26d51643f308cc651da695a Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Wed, 20 Dec 2023 20:14:08 +0330 Subject: [PATCH] feat(tsconfig-base): new package for TypeScript base config --- packages/tsconfig-base/README.md | 24 +++++++++ packages/tsconfig-base/package.json | 31 +++++++++++ packages/tsconfig-base/tsconfig.json | 77 ++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 packages/tsconfig-base/README.md create mode 100644 packages/tsconfig-base/package.json create mode 100644 packages/tsconfig-base/tsconfig.json diff --git a/packages/tsconfig-base/README.md b/packages/tsconfig-base/README.md new file mode 100644 index 00000000..945f5ca7 --- /dev/null +++ b/packages/tsconfig-base/README.md @@ -0,0 +1,24 @@ +# Alwatr TypeScript Config + +This is a base TypeScript configuration for Alwatr projects. + +## Usage + +Install the package: + +```bash +yarn add -D @alwatr/tsconfig-base +``` + +Create a `tsconfig.json` file in the root of your project: + +```json +{ + "extends": "@alwatr/tsconfig-base", + "compilerOptions": { + "rootDir": "src", + "outDir": "." + }, + "include": ["src/**/*.ts"], +} +``` diff --git a/packages/tsconfig-base/package.json b/packages/tsconfig-base/package.json new file mode 100644 index 00000000..8d29a036 --- /dev/null +++ b/packages/tsconfig-base/package.json @@ -0,0 +1,31 @@ +{ + "name": "@alwatr/tsconfig-base", + "version": "1.0.0", + "description": "This is a base TypeScript configuration for Alwatr projects.", + "keywords": [ + "typescript", + "tsconfig", + "tsconfig.json", + "tsconfig-base", + "esm", + "alwatr" + ], + "author": "S. Ali Mihandoost ", + "license": "MIT", + "files": [ + "tsconfig.json", + "**/*.{d.ts.map,d.ts,js.map,js,html,md}" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/Alwatr/nanolib", + "directory": "packages/tsconfig-base" + }, + "homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/tsconfig-base#readme", + "bugs": { + "url": "https://github.com/Alwatr/nanolib/issues" + } +} diff --git a/packages/tsconfig-base/tsconfig.json b/packages/tsconfig-base/tsconfig.json new file mode 100644 index 00000000..eadfd52d --- /dev/null +++ b/packages/tsconfig-base/tsconfig.json @@ -0,0 +1,77 @@ +{ + // https://www.typescriptlang.org/tsconfig + "compilerOptions": { + /* Basic Options */ + "incremental": true, + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["ES2023"], + // "allowJs": true, + // "checkJs": true, + // "jsx": "preserve", + "declaration": true, + // "outFile": "./", + "outDir": "./", + // "rootDir": "./src", + "composite": true, + "tsBuildInfoFile": ".tsbuildinfo", + // "removeComments": true, + // "noEmit": true, + // "emitDeclarationOnly": true, + // "importHelpers": true, + // "noEmitHelpers": true, + // "downlevelIteration": true, + "isolatedModules": true, // need for esbuild + + /* Strict Type-Checking Options */ + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + + /* Additional Checks */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + // "noUncheckedIndexedAccess": true, + // "noPropertyAccessFromIndexSignature": true, + + /* Module Resolution Options */ + // "paths": {}, + // "rootDirs": [], + // "typeRoots": [], + // "types": [], + "allowSyntheticDefaultImports": true, + // "esModuleInterop": true, + // "preserveSymlinks": true, + // "allowUmdGlobalAccess": true, + + /* Source Map Options */ + "sourceMap": true, + "declarationMap": true, + // "sourceRoot": "", + // "mapRoot": "", + // "inlineSourceMap": true, + "inlineSources": true, + + /* Experimental Options */ + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + + /* Advanced Options */ + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": true, + // "resolveJsonModule": true, // temporary for fix import json issue + + "listEmittedFiles": true, + // "diagnostics": true, + }, +}