Skip to content

Add unnecessary_underscores to core/recommended set. #856

Closed
@kallentu

Description

@kallentu

Describe the rule you'd like to see added and to what rule set

https://dart.dev/tools/linter-rules/unnecessary_underscores

When a user is using multiple underscores (__) and that variable isn't referenced, they should use a wildcard variable _ instead.

Enabling this lint will allow us to avoid that pattern which is also the point of having the wildcard variables feature 😀

This should at least be in the recommended lint set.
I'd love to see it in the core lint set though.

We should be encouraging users to use wildcard variables where they can and avoid multiple underscores all together. Wildcard variables provide static errors when used and would prevent errors like referencing an intentionally unused parameter by accident.

Additional context

See paragraph above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Under consideration

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions