Skip to content

Feature Request: Add --insert-ignore-comments flag to dart fix command for existing codeΒ #56098

Open
@ishchhabra

Description

@ishchhabra

This tracker is for issues related to:

  • Dart analyzer and linter

Description

As the language grows, we often introduce new lint rules to maintain and improve code quality. However, introducing new lint rules to large existing codebases can be challenging, especially when the rules are not auto-fixable. A common approach is to simply ignore the new lint rules for existing, working code and focus on ensuring the new code adheres to these rules.

Currently, this process requires developers to manually add ignore comments to existing code or write custom scripts to automate this task.

To streamline this process, a new --insert-ignore-comments flag can be added to dart fix command. This flag will only apply to lint rules that do not have an automatic fix and will allow developers to focus on improving new code without the immediate need to refactor legacy code.

I have created a quick (functional but with errors after it adds comments) prototype to demonstrate this idea. In case this is something that the Dart team agrees could be a valid feature, I'd love to contribute. I would love to learn the thoughts and opinions of the Dart team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.dart-cli-fixtype-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