Skip to content

Commit

Permalink
Improve TypeScript config
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Nov 8, 2023
1 parent 953cf4c commit 7bd76ed
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/react-pdf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"prepack": "yarn clean && yarn build",
"prettier": "prettier --check . --cache",
"test": "yarn lint && yarn tsc && yarn prettier && yarn unit",
"tsc": "tsc --noEmit",
"tsc": "tsc",
"unit": "vitest",
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\""
},
Expand Down
6 changes: 6 additions & 0 deletions packages/react-pdf/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"],
"exclude": ["src/**/*.spec.ts", "src/**/*.spec.tsx"]
}
3 changes: 2 additions & 1 deletion packages/react-pdf/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"jsx": "react",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
"target": "es2015",
"verbatimModuleSyntax": true
},
"include": ["src"]
"exclude": ["dist"]
}
1 change: 1 addition & 0 deletions sample/create-react-app-5/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions sample/parcel2/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions sample/vite3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions sample/vite4/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions sample/webpack5/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"prettier": "prettier --check . --cache",
"test": "yarn lint && yarn tsc && yarn prettier",
"tsc": "tsc --noEmit"
"tsc": "tsc"
},
"author": {
"name": "Wojciech Maj",
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"jsx": "react-jsx",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"strict": true,
Expand Down

0 comments on commit 7bd76ed

Please sign in to comment.