Proof of concept test migration -- client > utils > getConfig #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proof of concept for starting to migrate the client folder
Context:
Experimentation with starting to migrate the client folder to typescript and to set up automatic typescript checking
Starts to address work required in Month 1 and some of the challenges described in my proposal:
Chose to migrate utils/getConfig as the instance of a node file for Month 1 as this file had an associated unit test and the useage throughout the repo was relatively straightforward
I have a second PR that starts to migrate client/common/ButtonOrLink here which is separated from this PR for clarity
Changes
typescript
and typescript related deps/types forbabel
,node
,react
webpack
,babel
andeslint
configs to be able to parse.ts
and.tsx
files@typescript-eslint/parser
and@typescript-eslint
but got blocked due to eslint version peer-dependencytypecheck:client
to check for typescript errors on client filestest:watch
script for easier unit test-writingclient/utils/getConfig
& updated unit testsisTestEnvironment()
function to prevent circularitygetConfig()
to take an options object param that includes indicating whether it should output nullish strings (''
) and/or output a desired type, such as a numbergetConfig()
Screenshots:
getConfig()
useage2. Example of instance where the nullish value expected should be `''` instead of `undefined` --> in this file, it would result in `'undefined'` if this update to `getConfig()` was not made
3. Example of instance where nullish value expectd should be `undefined` -- getConfig can handle this as default