From 8f296b64e6c76312271ba51918e1e53faec7fdc0 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 31 Dec 2023 17:12:00 +0100 Subject: [PATCH] chore: use `Object.fromEntries` over `reduce` (#14822) --- .eslintrc.cjs | 1 - packages/jest-each/src/table/template.ts | 6 +----- scripts/buildUtils.mjs | 9 +++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index c368874f1b0d..e1cbe3dc283b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -697,7 +697,6 @@ module.exports = { // TODO: turn on at some point 'unicorn/error-message': 'off', - 'unicorn/prefer-object-from-entries': 'off', 'unicorn/prefer-string-replace-all': 'off', // enabling this is blocked by https://github.com/microsoft/rushstack/issues/2780 diff --git a/packages/jest-each/src/table/template.ts b/packages/jest-each/src/table/template.ts index 136842f17012..8def80677a79 100644 --- a/packages/jest-each/src/table/template.ts +++ b/packages/jest-each/src/table/template.ts @@ -10,7 +10,6 @@ import type {Global} from '@jest/types'; import type {EachTests} from '../bind'; import { type Headings, - type Template, type Templates, interpolateVariables, } from './interpolation'; @@ -41,8 +40,5 @@ const convertTableToTemplates = ( headings: Headings, ): Templates => table.map(row => - row.reduce