Options.fromJson constructor

Options.fromJson(
  1. Map? json
)

Implementation

factory Options.fromJson(Map? json) {
  final ignoreLints = json?['ignore_lints'];

  return Options(
    ignoreLints: switch (ignoreLints) {
      List<String>() => ignoreLints,
      List() => ignoreLints.map((e) => '$e').toList(),
      String() => [ignoreLints],
      _ => [],
    },
  );
}