actions / actions/toolkit

Change occurrences of `any` to `unknown` and remove `no-explicit-any` annotations

Open
#843 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.