Skip to content

Commit

Permalink
Add template for tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
portdeveloper committed Oct 26, 2024
1 parent 5ad5d8e commit 2783fe3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-shrimps-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

templates: added template for tsconfig.json file
28 changes: 0 additions & 28 deletions templates/base/packages/nextjs/tsconfig.json

This file was deleted.

45 changes: 45 additions & 0 deletions templates/base/packages/nextjs/tsconfig.json.template.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { withDefaults } from '../../../utils.js'

const contents = ({ extraPaths, extraPlugins, extraCompilerOptions, extraInclude, extraExclude }) => `{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"~~/*": ["./*"]${extraPaths[0] ? `,${extraPaths[0]}` : ''}
},
"plugins": [
{
"name": "next"
}${extraPlugins[0] ? `,${extraPlugins[0]}` : ''}
]${extraCompilerOptions[0] ? `,${extraCompilerOptions[0]}` : ''}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"${extraInclude[0] ? `,${extraInclude[0]}` : ''}
],
"exclude": [
"node_modules"${extraExclude[0] ? `,${extraExclude[0]}` : ''}
]
}`

export default withDefaults(contents, {
extraPaths: '',
extraPlugins: '',
extraCompilerOptions: '',
extraInclude: '',
extraExclude: ''
})

0 comments on commit 2783fe3

Please sign in to comment.