Skip to content

Commit 48c9384

Browse files
committed
refactor(eslint): fix unicorn/prefer-top-level-await (refs SFKUI-6500)
1 parent 66f8c6e commit 48c9384

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

docs/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ async function importIcons() {
1313
}
1414
}
1515

16-
importIcons();
17-
1816
config.teleportTarget = document.getElementById("teleport-target");
17+
18+
await importIcons();

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ export default [
151151
"unicorn/prefer-query-selector": "off",
152152
"unicorn/prefer-set-has": "off",
153153
"unicorn/prefer-string-slice": "off",
154-
"unicorn/prefer-top-level-await": "off",
155154
},
156155
},
157156
];

packages/icon-lib-builder/scripts/build.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ async function main() {
241241
buildDemo();
242242
}
243243

244-
main().catch((err) => {
244+
try {
245+
await main();
246+
} catch (err) {
245247
console.error(err);
246248
process.exitCode = 1;
247-
});
249+
}

packages/test-utils/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ async function build() {
3636
}
3737
}
3838

39+
/* eslint-disable-next-line unicorn/prefer-top-level-await -- technical debt, this file runs as commonjs */
3940
build().catch((err) => {
4041
console.error(err);
4142
});

packages/vue/src/components/FIcon/examples/FIconAll.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function decamelize(value: string): string {
2121
return value.replaceAll(/([A-Z])/g, (_, ch: string) => `-${ch.toLowerCase()}`);
2222
}
2323
24+
/* eslint-disable-next-line unicorn/prefer-top-level-await -- technical debt, this is just a hack */
2425
const iconsPromise = importIcons();
2526
2627
export default defineComponent({

0 commit comments

Comments
 (0)