@jimmy.codes/eslint-config
Version:
A simple, modern ESLint config that covers most use cases.
16 lines (15 loc) • 430 B
JavaScript
//#region src/utils/upwarn.ts
/**
* Converts all ESLint rules set to `"warn"` into `"error"`.
*
* @param rules - A partial set of ESLint rules.
*
* @returns A new rules object with all `"warn"` values changed to `"error"`.
*/
const upwarn = (rules = {}) => {
return Object.fromEntries(Object.entries(rules).map(([rule, option]) => {
return [rule, option === "warn" ? "error" : option];
}));
};
//#endregion
export { upwarn };