Answers for "tsconfig.json example"

PHP
9

typescript config

//type config configuration
{
	"compilerOptions": {
		"outDir": "dist",
		"target": "ESNext",
		"module": "CommonJS",
		"moduleResolution": "node",
		"esModuleInterop": true,
		"downlevelIteration": true,
		"allowSyntheticDefaultImports": true,
		"importHelpers": true,
		"skipLibCheck": true,
		"sourceMap": true,
		"removeComments": true,
		"noEmitOnError": true,
		"strict": false,
		"alwaysStrict": false,
		"noImplicitAny": false,
		"typeRoots": ["node_modules/@types/"]
	},
	"include": ["server.ts", "src/**/*.ts", "knexfile.ts"],
	"exclude": ["node_modules", "dist", "__tests__"]
}


// my package.json
{
	"name": "express-payment-gateway",
	"version": "1.0.0",
	"description": "express payment gateway",
	"main": "dist/server.js",
	"scripts": {
		"cleanup": "rimraf dist",
		"compiler": "tsc --pretty",
		"compiler:watch": "tsc --watch",
		"build": "npm run cleanup && npm run compiler",
		"start": "node dist/server.js",
		"dev": "nodemon -w *.ts -e ts -x ts-node --files -H -T server.ts"
	},
	"repository": {
		"type": "git",
		"url": "restuwahyu13"
	},
	"keywords": [
		"wabot",
		"whatsapp"
	],
	"author": "restuwahyu13",
	"license": "MIT",
	"dependencies": {
		"@sendgrid/mail": "^7.4.0",
		"bcryptjs": "^2.4.3",
		"body-parser": "^1.19.0",
		"compression": "^1.7.4",
		"cookie-parser": "^1.4.5",
		"cors": "^2.8.5",
		"express": "^4.17.1",
		"express-rate-limit": "^5.2.3",
		"express-slow-down": "^1.4.0",
		"express-validator": "^6.9.2",
		"helmet": "^4.2.0",
		"js-base64": "^3.6.0",
		"jsonwebtoken": "^8.5.1",
		"knex": "^0.21.15",
		"moment": "^2.29.1",
		"multer": "^1.4.2",
		"pg": "^8.5.1",
		"uuid": "^8.3.2"
	},
	"devDependencies": {
		"@types/bcryptjs": "^2.4.2",
		"@types/body-parser": "^1.19.0",
		"@types/compression": "^1.7.0",
		"@types/cookie-parser": "^1.4.2",
		"@types/cors": "^2.8.9",
		"@types/eslint": "^7.2.6",
		"@types/express": "^4.17.9",
		"@types/express-rate-limit": "^5.1.0",
		"@types/express-slow-down": "^1.3.0",
		"@types/express-validator": "^3.0.0",
		"@types/helmet": "^4.0.0",
		"@types/http-errors": "^1.8.0",
		"@types/js-base64": "^3.0.0",
		"@types/jsonwebtoken": "^8.5.0",
		"@types/knex": "^0.16.1",
		"@types/moment": "^2.13.0",
		"@types/morgan": "^1.9.2",
		"@types/multer": "^1.4.5",
		"@types/node": "^14.14.16",
		"@types/pg": "^7.14.7",
		"@types/request": "^2.48.5",
		"@types/sendgrid": "^4.3.0",
		"@types/uuid": "^8.3.0",
		"@typescript-eslint/eslint-plugin": "^4.11.0",
		"@typescript-eslint/parser": "^4.11.1",
		"babel-eslint": "^10.1.0",
		"dotenv": "^8.2.0",
		"eslint": "^7.16.0",
		"eslint-config-prettier": "^7.1.0",
		"eslint-config-standard": "^16.0.2",
		"eslint-plugin-import": "^2.22.1",
		"eslint-plugin-jest": "^24.1.3",
		"eslint-plugin-node": "^11.1.0",
		"eslint-plugin-prettier": "^3.3.0",
		"eslint-plugin-promise": "^4.2.1",
		"husky": "^4.3.6",
		"morgan": "^1.10.0",
		"nodemon": "^2.0.6",
		"npm": "^7.3.0",
		"prettier": "2.2.1",
		"rimraf": "^3.0.2",
		"ts-node": "^9.1.1",
		"typescript": "^4.1.3"
	}
}
Posted by: Guest on August-20-2020
4

tsconfig.json not generated

$ tsc --init
Posted by: Guest on January-12-2020
0

typescript tsconfig.json file

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es2016",
    "jsx": "react-jsx",
    "strictFunctionTypes": true,
    "sourceMap": true,
    "outDir": "./build",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  },
  "exclude": ["node_modules", "**/node_modules/*"],
  "include": ["src", "electron/renderer.ts"]
}
Posted by: Guest on July-23-2021
1

init tsconfig file

// source from https://stackoverflow.com/questions/36916989/how-can-i-generate-a-tsconfig-json-file
$ tsc --init
// Try to run in your console the following to check the version:
$ tsc -v
// If the version is older than 1.6 you will need to update:
$ npm install -g typescript
// Remember that you need to install node.js to use npm.
Posted by: Guest on September-22-2021
1

tsconfig configuration

{
  "compilerOptions": {
    "target": "ES2015",
    "module": "commonjs",
    "lib": [ "ES2015", "dom" ],
    "sourceMap": true,
    "outDir": "./script", 
    "strict": true, 
    "strictNullChecks": true, 
    "strictFunctionTypes": true, 
    "noImplicitThis": true, 
    "alwaysStrict": true, 
    "noImplicitReturns": true, 
    "noFallthroughCasesInSwitch": true,
    "esModuleInterop": true,
    "experimentalDecorators": true, 
  }
}
Posted by: Guest on May-25-2021
0

tsconfig.json example

{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "sourceMap": true
  },
  "files": [
    "core.ts",
    "sys.ts",
    "types.ts",
    "scanner.ts",
    "parser.ts",
    "utilities.ts",
    "binder.ts",
    "checker.ts",
    "emitter.ts",
    "program.ts",
    "commandLineParser.ts",
    "tsc.ts",
    "diagnosticInformationMap.generated.ts"
  ]
}
Posted by: Guest on October-15-2021

Browse Popular Code Answers by Language