Skip to content

chore(lint): prefer 'unknown' to 'any', fix lint warnings #18489

@github-actions

Description

@github-actions

Note

The pull request "chore(lint): prefer 'unknown' to 'any', fix lint warnings" was created by @isaacs but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

Explicitly enable any usage in typescript in:

  • dev-packages, since those are largely integration and E2E tests. (This is done with the addition of a dev-packages/.eslintrc.js file.)
  • packages/*/test/, since those are all tests. (This is done with a rule override added to the root .eslintrc.js file.)
  • Several one-off allowances, generally for vendored types from third party sources, and cases involving method overwriting that TypeScript can't follow. (These are done with file/line overrides, explicit as casting, and adding type inference to the isInstanceOf method.)

In other places (ie, in exported production code paths), replace any with unknown, and upgrade the @typescript/no-explicit-any lint rule to an error.

This silences a lot of eslint warnings that were habitually ignored, and encourages us to not opt out of strict type safety in our exported code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions