Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

generate tsconfig

npx tsc --init
Comment

tsconfig.json not generated

$ tsc --init
Comment

tsconfig

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": [
    "src"
  ]
}
Comment

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"]
}

Comment

basic tsconfig file

{
    "compilerOptions": {
      "outDir": "./dist/",
+     "sourceMap": true,
      "noImplicitAny": true,
      "module": "commonjs",
      "target": "es5",
      "jsx": "react",
      "allowJs": true,
      "moduleResolution": "node",
    }
  }
Comment

generate tsconfig

[1] $ tsc -v
[2] If the version is older than 1.6:
	$ npm install -g typescript
[3] $ tsc --init
Comment

tsconfig.json

// mytsconfig.
{
    "compilerOptions": {
        "allowJs": true,
        "checkJs": false,
        "allowSyntheticDefaultImports": true,
        "esModuleInterop": true,
        "typeRoots": ["src/types", "node_modules/@types"],
        "baseUrl": "src",
        "paths": {
            "@/*": ["*"] // matching @src/* to src/*
        },
        "outDir": "dist",
        "experimentalDecorators": true,
        
    },
    "exclude": ["node_modules", "dist"],
    "include": ["src/**/*","src/*"]
}
Comment

tsconfig.json, Typescript

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "jsxImportSource": "preact"
  }
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: [(ngModel)] input error 
Typescript :: split dict into multiple dicts python 
Typescript :: java 8 collect multiple lists into single list 
Typescript :: how to keep only certian objects python 
Typescript :: filter typescript 
Typescript :: two absolute elements are overlapping css help 
Typescript :: outputs i angular 
Typescript :: go Array’s length is part of its type. 
Typescript :: Index signature property 
Typescript :: cmd move all files to parent directory 
Typescript :: typescript function 
Typescript :: compare two lists and find at least one equal python 
Typescript :: bits required for address 1 GB memory 
Typescript :: react fc typescript 
Typescript :: flutter constructor default value 
Typescript :: google sheets query multiple or 
Typescript :: download blob typescript 
Typescript :: test coverage techniques 
Typescript :: adding font in nextjs 
Typescript :: props react typescript 
Typescript :: typescript how to define class properties to empty 
Typescript :: undetermined number of arguments in function r 
Typescript :: useappdispatch 
Typescript :: porque la ejecución de scripts está deshabilitada en este sistema 
Typescript :: get all products woocommerce with sql 
Typescript :: Using TypeScript generic with `...rest` operator 
Typescript :: write getter angular 
Typescript :: typeorm versioncolumn 
Typescript :: They Take Their Medication Then The Device Owner Lets Them Press The Button | The Problem We Are Solving Is Kids Not Taking Their Medication Which Turns To Great Health Benefits In The Young Generation 
Typescript :: see all github issue comments i made site:stackoverflow.com 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =