Skip to content

New lint to make parameters/variables/fields non-nullable if ! is used unconditionally for them. #58674

@polina-c

Description

@polina-c

For example, for the code

void hello(String? name){
  print('Hello, ${name!.trim()}!');
}

the lint would suggest:

void hello(String name){
  print('Hello, ${name.trim()}!');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions