merge method

Merges two configs into a single one.

Config coming from overrides has a higher priority and overrides conflicting entries.

Implementation

UnnecessaryNullableConfig merge(UnnecessaryNullableConfig overrides) =>
    UnnecessaryNullableConfig(
      excludePatterns: {...excludePatterns, ...overrides.excludePatterns},
      analyzerExcludePatterns: {
        ...analyzerExcludePatterns,
        ...overrides.analyzerExcludePatterns,
      },
      isMonorepo: isMonorepo || overrides.isMonorepo,
      shouldPrintConfig: shouldPrintConfig || overrides.shouldPrintConfig,
    );