diff --git a/.oxlintrc.jsonc b/.oxlintrc.jsonc index a3e0883..ceac526 100644 --- a/.oxlintrc.jsonc +++ b/.oxlintrc.jsonc @@ -130,6 +130,11 @@ // =================== // Enforce top-level type specifier style "import/consistent-type-specifier-style": ["error", "top-level"], + // =================== + // Unicorn Rules + // =================== + // Disable top-level await in src (library code should not use top-level await) + "unicorn/prefer-top-level-await": "off", // Ensure imports are at the top "import/first": "error", // Disallow duplicate imports @@ -154,5 +159,13 @@ "typescript/no-floating-promises": "warn", }, }, + { + // Examples should use top-level await for cleaner code + "files": ["examples/**/*.ts"], + "rules": { + "no-console": "off", + "unicorn/prefer-top-level-await": "error", + }, + }, ], }