scripting: Disable an eslint warning

Calling await in a loop means the asynchronous operations are
run sequentially instead of in-parallel. Usually that's not
what's wanted, so eslint has a rule to warn about this.

However here we use async/await to handle control back to the
mainloop between steps, so running operations sequentially is
actually intended.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
This commit is contained in:
Florian Müllner 2019-08-20 02:36:36 +02:00
parent 1a32e3e74a
commit e585f7d97b

View File

@ -317,7 +317,7 @@ async function runPerfScript(scriptModule, outputFile) {
for (let step of scriptModule.run()) {
try {
await step;
await step; // eslint-disable-line no-await-in-loop
} catch (err) {
log(`Script failed: ${err}\n${err.stack}`);
Meta.exit(Meta.ExitCode.ERROR);