Skip to content

Commit 085c1d0

Browse files
authored
chore: make TypeScript strict by default in packages and 7 packages stricter (#10579)
This PR modifies `tsconfig.base.json` by setting the following strictness properties to true: `strict`, `noUncheckedIndexedAccess` and `noImplicitOverride`. In packages where compilation errors were observed, these settings were opted out, and TODO comments were added to make it easier to track the roadmap for converting everything to strict mode. The following packages now have increased strictness, which prevents new errors from being accidentally introduced: - storage-vercel-blob - storage-s3* - storage-gcs - plugin-sentry - payload-cloud* - email-resend* - email-nodemailer* *These packages already had `strict: true`, but now have `noUncheckedIndexedAccess` and `noImplicitOverride`. Note that this only affects the `/packages` folder, but not `/templates`, `/test` or `/examples` which have a different `tsconfig`.
1 parent 61117ee commit 085c1d0

File tree

30 files changed

+147
-17
lines changed

30 files changed

+147
-17
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"strict": true
4+
/* TODO: remove the following lines */
5+
"noUncheckedIndexedAccess": false,
6+
"noImplicitOverride": false,
57
},
68
}

packages/db-mongodb/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [{ "path": "../payload" }, { "path": "../translations" }]
410
}

packages/db-postgres/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [
410
{
511
"path": "../payload"

packages/db-sqlite/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [
410
{
511
"path": "../payload"

packages/db-vercel-postgres/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [
410
{
511
"path": "../payload"

packages/drizzle/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [{ "path": "../payload" }, { "path": "../translations" }]
410
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"strict": true
5-
},
63
"references": [{ "path": "../payload" }]
74
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"strict": true
5-
},
63
"references": [{ "path": "../payload" }]
74
}

packages/graphql/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [{ "path": "../payload" }]
410
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
/* TODO: remove the following lines */
5+
"strict": false,
6+
"noUncheckedIndexedAccess": false,
7+
"noImplicitOverride": false,
8+
},
39
"references": [{ "path": "../payload" }]
410
}

0 commit comments

Comments
 (0)