Skip to content

Commit

Permalink
feat(tsconfig-base): new package for TypeScript base config
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Dec 20, 2023
1 parent b835cd8 commit 33bb94e
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/tsconfig-base/README.md
Original file line number Diff line number Diff line change
@@ -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"],
}
```
31 changes: 31 additions & 0 deletions packages/tsconfig-base/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"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"
}
}
77 changes: 77 additions & 0 deletions packages/tsconfig-base/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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,
},
}

0 comments on commit 33bb94e

Please sign in to comment.