Skip to content

docs(eslint-plugin): [no-explicit-any] add alternatives #11199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented May 9, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e90b396
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/681e494c7edce000080c9709
😎 Deploy Preview https://deploy-preview-11199--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

## Alternatives to `any`

Which type(s) to use instead of `any` depends on the context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find references of other non-straightforward scenarios to add... are there others we should mention?

Copy link

nx-cloud bot commented May 9, 2025

View your CI Pipeline Execution ↗ for commit e90b396.

Command Status Duration Result
nx test eslint-plugin ✅ Succeeded 6m 5s View ↗
nx run eslint-plugin:test -- --coverage ✅ Succeeded 6m 23s View ↗
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 7s View ↗
nx test scope-manager ✅ Succeeded 1s View ↗
nx test typescript-estree ✅ Succeeded 1s View ↗
nx run types:build ✅ Succeeded 1s View ↗
nx typecheck ast-spec ✅ Succeeded 2s View ↗
nx run-many --target=build --exclude website --... ✅ Succeeded 6s View ↗
Additional runs (26) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-05-09 18:41:42 UTC

## Alternatives to `any`

Which type(s) to use instead of `any` depends on the context.

Copy link
Member Author

@JoshuaKGoldberg JoshuaKGoldberg May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add more straightforward cases from earlier in the file...

  • If the type is known, describing it in an interface or type
    • Mention [i: string]/etc. index signatures too, either inside or alongside
  • If the type is not known, using the safer unknown type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Add explainer around any alternatives with no-explicit-any
1 participant