Altinn / Altinn/app-frontend-react
Technical debt: `noImplicitAny`
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
Working in a TypeScript codebase is fantastic, and it really shines when using strict typing for everything, as you can be fairly confident when refactoring. I've spent full days refactoring strictly-typed TypeScript codebases, and everything worked on the first try as soon as the type-checker had no more errors to report. We should aim towards stricter type-checking to increase confidence when making changes to our codebase.
This issue speficially includes the work needed to set `noImplicitAny` to `true` in `tsconfig.json`. Setting this to `true` currently exposes 261 errors in main, most of which are easy to fix. Implicit `any` is usually caused by failing inferred types, which in turn is caused by overly lax typing on our end.
Also consider [denying explicit `any`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-explicit-any.md), making the project very strict (but hardened).
### Related issues
- #556
Contributor guide
Research direction
Start with tsconfig.json and enable noImplicitAny to reproduce the 261 errors reported in main. Work through the exposed errors across the TypeScript codebase, then run the project's type-checking workflow until noImplicitAny passes; consider the linked #556 context before evaluating explicit any.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100