Skip to content

Commit

Permalink
feat: rework tsconfig, add nextjs preset
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Dec 21, 2022
1 parent e4f1811 commit 58e83bc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-horses-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@wayofdev/tsconfig-config': minor
---

feat: rework tsconfig, add nextjs preset
30 changes: 24 additions & 6 deletions packages/tsconfig-config/base.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
// https://github.com/tsconfig/bases/blob/main/bases/recommended.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "recommended base tsconfig",
"compilerOptions": {
"target": "ES2015",
"module": "commonjs",
"strict": true,
"allowJs": false,
"alwaysStrict": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"resolveJsonModule": true,
"removeComments": true,
"preserveConstEnums": true,
"incremental": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"target": "es5",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Recommended"
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowUnreachableCode": false,
"noFallthroughCasesInSwitch": true
}
}
10 changes: 3 additions & 7 deletions packages/tsconfig-config/lib.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "tsconfig for react libraries",
"extends": "./base.json",
"compilerOptions": {
"composite": false,
"noEmit": false,
"declaration": true,
"declarationMap": true,
"incremental": true,
"sourceMap": true,
"importHelpers": true,
"allowJs": true
"importHelpers": true
}
}
17 changes: 17 additions & 0 deletions packages/tsconfig-config/next.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "tsconfig for nextjs",
"extends": "./base.json",
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"noEmit": true,
"importHelpers": true,
"module": "esnext",
"isolatedModules": true,
"jsx": "preserve"
}
}
1 change: 1 addition & 0 deletions packages/tsconfig-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"files": [
"base.json",
"lib.json",
"next.json",
"scripts/*"
],
"scripts": {
Expand Down

0 comments on commit 58e83bc

Please sign in to comment.