Change occurrences of `any` to `unknown` and remove `no-explicit-any` annotations
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
TypeScript allows developers to annotate their types with an any type. It, along with unknown, are top types: they are capable of describing all types in the type system. The difference between them, however, is that any describes all the types simultaneously.
There are several instances within the codebase that circumvent the type system by typing a value as any. Furthermore, many such instances suppress lint errors relating to such circumvention via the ESLint eslint-disable annotation.
function parse(input: any) {
return input.toString();
}
parse("asdf");
// => "asdf"
parse({ "__proto__": { "toString": () => "asdf" } });
// => "asdf"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked GitHub code search for no-explicit-any and inspect the TypeScript annotations across the toolkit. Replace applicable any usages with unknown and remove the matching ESLint disable annotations, then verify the project's TypeScript and ESLint checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100