Skip to content

Always document Any? #12428

Closed
Closed
@srittau

Description

@srittau

I'd like to propose a policy that we require any use of un-aliased Any to be accompanied by a comment described why the Any is needed. Using Any is always a bit of a red flag to me (although of course often needed), and it's often not overly obvious why Any is required. We've started to tackle this problem in the past by adding few aliases to better document the use of Any, which was a great start. But sometimes it's also not clear whether Any is really required or whether it's just a placeholder. And that situation also changes over time as the type system gains new features.

Of course, this only applies to new or changed annotations. I don't propose that we need to go through all existing Anys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: policyOrganization of the typeshed project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions