diego3g / electron-typescript-react

:electron: An Electron boilerplate including TypeScript, React, Jest and ESLint.
1.45k stars 295 forks source link

problem of tsconfig #29

Closed charminghiker closed 3 years ago

charminghiker commented 3 years ago

need add typeRoots


  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "lib": [
      "dom",
      "es2015",
      "es2016",
      "es2017"
    ],
    "allowJs": true,
    "jsx": "react",
    "jsxFactory": "React.createElement",
    "sourceMap": true,
    "outDir": "./dist",
    "strict": true ,
    "esModuleInterop": true,
    "typeRoots": [
      "node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules",
    "dist"
  ]
}``
diego3g commented 3 years ago

The @types folder from node_modules is the default option of typeRoots, but you can always customize as the tsconfig is open for changes when you use the template.