[8.6] Code cleanup: Remove unnecessary Promise.all (#150094) (#150109)

# Backport

This will backport the following commits from `main` to `8.6`:
- [Code cleanup: Remove unnecessary Promise.all
(#150094)](https://github.com/elastic/kibana/pull/150094)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Thomas
Watson","email":"watson@elastic.co"},"sourceCommit":{"committedDate":"2023-02-01T20:52:21Z","message":"Code
cleanup: Remove unnecessary Promise.all
(#150094)","sha":"a858201aa14849f2a7f7b81af933265f3f866326","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v8.7.0"],"number":150094,"url":"https://github.com/elastic/kibana/pull/150094","mergeCommit":{"message":"Code
cleanup: Remove unnecessary Promise.all
(#150094)","sha":"a858201aa14849f2a7f7b81af933265f3f866326"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150094","number":150094,"mergeCommit":{"message":"Code
cleanup: Remove unnecessary Promise.all
(#150094)","sha":"a858201aa14849f2a7f7b81af933265f3f866326"}}]}]
BACKPORT-->

Co-authored-by: Thomas Watson <watson@elastic.co>
This commit is contained in:
Kibana Machine 2023-02-01 17:44:49 -05:00 committed by GitHub
parent 4b09263a15
commit 3e592177c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,23 +54,21 @@ async function generate() {
{}
);
await Promise.all([
writeFile(
outputFieldMapFilename,
`
await writeFile(
outputFieldMapFilename,
`
/* This file is generated by x-pack/plugins/rule_registry/scripts/generate_ecs_fieldmap/index.js,
do not manually edit
*/
export const ecsFieldMap = ${JSON.stringify(fields, null, 2)} as const
export const ecsFieldMap = ${JSON.stringify(fields, null, 2)} as const
export type EcsFieldMap = typeof ecsFieldMap;
`,
{ encoding: 'utf-8' }
).then(() => {
return exec(`node scripts/eslint --fix ${outputFieldMapFilename}`);
}),
]);
export type EcsFieldMap = typeof ecsFieldMap;
`,
{ encoding: 'utf-8' }
);
await exec(`node scripts/eslint --fix ${outputFieldMapFilename}`);
}
generate().catch((err) => {