Skip to content

Commit

Permalink
feat: respect option to disable all rules at once
Browse files Browse the repository at this point in the history
  • Loading branch information
gbassisp committed Nov 23, 2023
1 parent 8281fa4 commit feac16a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/src/flutter_sane_lints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,22 @@ class _FlutterSaneLints extends PluginBase {
}

@override
List<LintRule> getLintRules(CustomLintConfigs configs) => [
const AvoidStringLiteralsInsideWidget(),
const AvoidIfWithEnum(),
];
List<LintRule> getLintRules(CustomLintConfigs configs) {
final enabled = configs.enableAllLintRules ?? true;
if (!enabled) {
return [];
}

// final rules = configs.rules;
// for (final element in rules.entries) {
// print('${element.key}: ${element.value.json}');
// }

return [
const AvoidStringLiteralsInsideWidget(),
const AvoidIfWithEnum(),
];
}
}

/// A [DartLintRule] that raises a warning on string literals declared inside
Expand Down

0 comments on commit feac16a

Please sign in to comment.