Skip to content

Commit

Permalink
chore(typescript): disable exactOptionalPropertyTypes
Browse files Browse the repository at this point in the history
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.)

Closes #898

Signed-off-by: Drew Hess <[email protected]>
  • Loading branch information
dhess committed Apr 10, 2024
1 parent ac12b98 commit b1a079b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/TreeReactFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ export const ReactFlowSafe = <
// the tree in order to perform actions on them.
elementsSelectable: false,
onNodeClick: (e, n) => {
"onNodeClick" in p &&
p.onNodeClick &&
p.onNodeClick(
e,
// This cast is safe because `N` is also the type of elements of the `nodes` field.
Expand Down
8 changes: 4 additions & 4 deletions src/primer-api/primer-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const useGetSessionListHook = () => {
) => {
return getSessionList(
{url: `/openapi/sessions`, method: 'GET',
params, ...(signal ? { signal }: {})
params, signal
},
);
}
Expand Down Expand Up @@ -701,7 +701,7 @@ export const useGetSessionNameHook = () => {
signal?: AbortSignal
) => {
return getSessionName(
{url: `/openapi/sessions/${sessionId}/name`, method: 'GET', ...(signal ? { signal }: {})
{url: `/openapi/sessions/${sessionId}/name`, method: 'GET', signal
},
);
}
Expand Down Expand Up @@ -827,7 +827,7 @@ export const useGetProgramHook = () => {
signal?: AbortSignal
) => {
return getProgram(
{url: `/openapi/sessions/${sessionId}/program`, method: 'GET', ...(signal ? { signal }: {})
{url: `/openapi/sessions/${sessionId}/program`, method: 'GET', signal
},
);
}
Expand Down Expand Up @@ -1129,7 +1129,7 @@ export const useGetVersionHook = () => {
signal?: AbortSignal
) => {
return getVersion(
{url: `/openapi/version`, method: 'GET', ...(signal ? { signal }: {})
{url: `/openapi/version`, method: 'GET', signal
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"exactOptionalPropertyTypes": true,
"exactOptionalPropertyTypes": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitOverride": true,
Expand Down

0 comments on commit b1a079b

Please sign in to comment.