Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] feat:add babel plugin-transform-object-rest-spread #49643

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const defaultPlugins = [

'@babel/transform-runtime',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-transform-object-rest-spread', {useBuiltIns: true, loose: true}],

// We use `@babel/plugin-transform-class-properties` for transforming ReactNative libraries and do not use it for our own
// source code transformation as we do not use class property assignment.
Expand Down
8 changes: 5 additions & 3 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,11 @@ function getAllReportErrors(report: OnyxEntry<Report>, reportActions: OnyxEntry<
reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericSmartscanFailureMessage');
}
// All error objects related to the report. Each object in the sources contains error messages keyed by microtime
// Use Object.assign to merge all error objects into one since it is faster and uses less memory than spread operator
// eslint-disable-next-line prefer-object-spread
const errorSources = Object.assign({}, reportErrors, reportErrorFields, reportActionErrors);
const errorSources = {
reportErrors,
...reportErrorFields,
...reportActionErrors,
};

// Combine all error messages keyed by microtime into one object
const errorSourcesArray = Object.values(errorSources ?? {});
Expand Down
Loading