bcgov / bcgov/entity

sbc-common-components: fix strict TS errors in BaseAddress

Open
#2,559 1 comment 0 reactions 0 assignees View on GitHub
ENTITY - DO NOT USE Priority2 techdebt
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

## Description:
The sbc-common-components BaseAddress component is causing numerous errors when it is included in a project with `"strict": true` (such as bcrs-business-create-ui). This should be fixed by improving the "Typescript-ness" of the code (eg, by using types/interfaces). Disabling Typescript strictness, or declaring objects as "any" are not acceptable code practices.

Sample errors include:
```
Element implicitly has an 'any' type because index expression is not of type 'number'.
Object is possibly 'null'.
Element implicitly has an 'any' type because expression of type '"xxx"' can't be used to index type '{}'.
Parameter 'x' implicitly has an 'any' type.
Type 'null' is not assignable to type 'string'.
Object is possibly 'undefined'.
```

Acceptance for a Task:
- [ ] Requires deployments
- [ ] Add/ maintain selectors for QA purposes
- [ ] Test coverage acceptable
- [ ] Linters passed
- [ ] Peer Reviewed
- [ ] PR Accepted
- [ ] Production burn in completed

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the BaseAddress component in sbc-common-components and reproduce its errors from a project using "strict": true, such as bcrs-business-create-ui. Review the reported implicit-any, null, undefined, and indexing errors without disabling strictness or using any. Done means the strict TypeScript errors are resolved, QA selectors are maintained, test coverage is acceptable, and linters pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.