ErrorConfig constructor

ErrorConfig([
  1. Map<String, String>? codeMap
])

Create an error config for the given error code map. For example: new ErrorConfig({'missing_return' : 'error'}); will create a processor config that turns missing_return hints into errors.

Implementation

ErrorConfig([Map<String, String>? codeMap]) {
  if (codeMap != null) {
    for (final code in codeMap.keys) {
      final value = codeMap[code]!;

      var action = value.toLowerCase();
      if (ignoreWords.contains(action)) {
        processors.add(ErrorProcessor(code));
      } else {
        final severity = _toSeverity(action);
        if (severity != null) {
          processors.add(ErrorProcessor(code, severity));
        }
      }
    }
  }
}