Skip to content

Commit 5bbf5e3

Browse files
committed
chore(typescript): disable exactOptionalPropertyTypes
This setting is causing problems for us with one package we'd like to use: #1012 (comment) and is also preventing us from migrating to TypeScript 5 due to an upstream issue in `react-router` that's been unaddressed for almost a year: #898 There were no objections to disabling it, so we do so in this commit. (There is one minor code change required as a result, just an additional optional property check on a `onNodeClick` handler in our React Flow wrapper.) Signed-off-by: Drew Hess <[email protected]>
1 parent ac12b98 commit 5bbf5e3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/TreeReactFlow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ export const ReactFlowSafe = <
14151415
// the tree in order to perform actions on them.
14161416
elementsSelectable: false,
14171417
onNodeClick: (e, n) => {
1418-
"onNodeClick" in p &&
1418+
p.onNodeClick &&
14191419
p.onNodeClick(
14201420
e,
14211421
// This cast is safe because `N` is also the type of elements of the `nodes` field.

src/primer-api/primer-api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const useGetSessionListHook = () => {
118118
) => {
119119
return getSessionList(
120120
{url: `/openapi/sessions`, method: 'GET',
121-
params, ...(signal ? { signal }: {})
121+
params, signal
122122
},
123123
);
124124
}
@@ -701,7 +701,7 @@ export const useGetSessionNameHook = () => {
701701
signal?: AbortSignal
702702
) => {
703703
return getSessionName(
704-
{url: `/openapi/sessions/${sessionId}/name`, method: 'GET', ...(signal ? { signal }: {})
704+
{url: `/openapi/sessions/${sessionId}/name`, method: 'GET', signal
705705
},
706706
);
707707
}
@@ -827,7 +827,7 @@ export const useGetProgramHook = () => {
827827
signal?: AbortSignal
828828
) => {
829829
return getProgram(
830-
{url: `/openapi/sessions/${sessionId}/program`, method: 'GET', ...(signal ? { signal }: {})
830+
{url: `/openapi/sessions/${sessionId}/program`, method: 'GET', signal
831831
},
832832
);
833833
}
@@ -1129,7 +1129,7 @@ export const useGetVersionHook = () => {
11291129
signal?: AbortSignal
11301130
) => {
11311131
return getVersion(
1132-
{url: `/openapi/version`, method: 'GET', ...(signal ? { signal }: {})
1132+
{url: `/openapi/version`, method: 'GET', signal
11331133
},
11341134
);
11351135
}

tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"allowUnreachableCode": false,
2323
"allowUnusedLabels": false,
2424
"alwaysStrict": true,
25-
"exactOptionalPropertyTypes": true,
25+
"exactOptionalPropertyTypes": false,
2626
"noFallthroughCasesInSwitch": true,
2727
"noImplicitAny": true,
2828
"noImplicitOverride": true,

0 commit comments

Comments
 (0)