bcgov / bcgov/SIMS

Add TS rule to enforce thrown errors to be an instance of Error

Open
#2,773 1 comment 0 reactions 0 assignees View on GitHub
Dev & Architecture Task Technical Debt
Dominant language
TypeScript
Stars
29
Forks
15
PR merge metrics
No merged PRs in 30d

Description

**Context**
- If an error is thrown as string, the line number is not shown:
![image](https://github.com/bcgov/SIMS/assets/78114138/ab7a1f94-66f8-4eb9-837e-9db3440abb98)
![image](https://github.com/bcgov/SIMS/assets/78114138/295140ec-702b-45ec-a0a0-d136a67d7344)
- Reference: https://github.com/bcgov/SIMS/pull/2753

**Acceptance Criteria**
- [ ] Apply TS rules as in: https://typescript-eslint.io/rules/no-throw-literal/
- [ ] Check if there's still any place throwing error as string.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the typescript-eslint no-throw-literal rule linked in the acceptance criteria and review reference pull request #2753. Search the TypeScript codebase for locations that throw strings, enable or apply the rule, and confirm the lint check passes with no remaining string throws.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
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.