Skip to content

refactor registering fixes for each rule #285

Description

@andrew-bekhiet-solid

Instead of:

void main() {
  final rule = DoubleLiteralFormatRule();
  registry.registerLintRule(rule);
  registry.registerFixForRule(rule.code, DoubleLiteralFormatFix.new);
}

Add and implement an interface that exposes fixesForCodes getter that will return pairs of code and its fix constructor:

void main() {
  final rule = DoubleLiteralFormatRule();
  registry.registerLintRule(rule);
  for (final MapEntry(key: code, value: fixFn) in rule.fixesForCodes) {
    registry.registerFixForRule(code, fixFn);
  }
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions