function mergeRules(defaults, overrides) {
	// Overrides for default rules
	const rulesWithOverrides = defaults.map(rule => ({
		...rule,
		...overrides[rule.name],
	}));

	// Custom rules
	return Object.entries(overrides).reduce((acc, [name, rule]) => {
		if (acc.some(x => x.name === name)) {
			return acc;
		}
		return [...acc, rule];
	}, rulesWithOverrides);
}
Merge default rules with user overrides

@param {Array} defaults
@param {Object} overrides