Config.fromRules constructor

Config.fromRules(
  1. Map<String, LintOptions> rules
)

Implementation

factory Config.fromRules(Map<String, LintOptions> rules) {
  if (rules.isEmpty) {
    return Config();
  }

  try {
    return Config.fromMap(
      rules.entries.first.value.json,
    );
  } catch (error, stackTrace) {
    stdout.write(error);
    stdout.write(stackTrace);
    return Config();
  }
}