Adopt stricter oxlint config#194
Conversation
Expand the oxlint config with type-aware safety rules (no-unsafe-*, no-floating-promises, strict-void-return, no-confusing-void-expression, no-deprecated, prefer-nullish-coalescing), consistency rules (consistent-type-imports/exports/definitions, array-type, promise-function-async), and unicorn rules (prefer-node-protocol, no-useless-undefined, no-await-expression-member, catch-error-name). Add overrides relaxing the unsafe-* rules in tests and in lockfile/helpers (which interact with untyped third-party APIs). Conform existing code: switch interfaces to types, add node: prefixes, replace || with ??, eliminate non-null assertions, rename catch variables from err to error, and resolve other minor rule violations.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e943e62. Configure here.
|
Caution Review failedFailed to post review comments WalkthroughThis PR expands oxlint configuration and updates lint scripts to enable import-aware, type-aware checks; converts getBuildOutputDir from async to sync and updates its call site; standardizes catch variables to 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cfd071d-52fa-4b00-aa91-c7d34106a23c
📒 Files selected for processing (26)
.oxlintrc.jsonpackage.jsonsrc/isolate-bin.tssrc/isolate.tssrc/lib/config.tssrc/lib/lockfile/helpers/bun-lockfile.tssrc/lib/lockfile/helpers/generate-bun-lockfile.tssrc/lib/lockfile/helpers/generate-npm-lockfile.tssrc/lib/lockfile/helpers/generate-pnpm-lockfile.tssrc/lib/lockfile/helpers/generate-yarn-lockfile.tssrc/lib/manifest/helpers/adopt-pnpm-fields-from-root.tssrc/lib/manifest/helpers/resolve-catalog-dependencies.tssrc/lib/manifest/validate-manifest.tssrc/lib/output/get-build-output-dir.tssrc/lib/package-manager/helpers/infer-from-files.tssrc/lib/patches/collect-installed-names-bun.tssrc/lib/patches/collect-installed-names-pnpm.tssrc/lib/patches/copy-patches.test.tssrc/lib/registry/create-packages-registry.tssrc/lib/types.tssrc/lib/utils/get-dirname.tssrc/lib/utils/json.tssrc/lib/utils/pack.tssrc/lib/utils/reset-isolate-dir.tssrc/lib/utils/wait-for-complete-file.tssrc/lib/utils/yaml.ts
💤 Files with no reviewable changes (1)
- src/lib/patches/copy-patches.test.ts
Always exit non-zero from the CLI on rejection, including when the rejected value is not an Error. Previously the CLI would log the failure and exit 0. Pass cwd to exec instead of mutating process.cwd in pack(). The previous code restored cwd only on the success path, so any rejection or assertion failure left the process in srcDir.

Expand the oxlint configuration with type-aware safety rules
(
no-unsafe-*,no-floating-promises,strict-void-return,no-confusing-void-expression,no-deprecated,prefer-nullish-coalescing), consistency rules(
consistent-type-imports/exports/definitions,array-type,promise-function-async), and unicorn rules(
prefer-node-protocol,no-useless-undefined,no-await-expression-member,catch-error-name). Thepedanticcategory is enabled at the
warnlevel so its findings are visiblewithout being blocking.
Test files and
src/lib/lockfile/helpers/**get scoped overridesthat relax the
no-unsafe-*rules — those helpers interact withuntyped third-party APIs (
@npmcli/arborist,@pnpm/lockfile-file)where the warnings would be noise.
Existing source is conformed to the new rules: interfaces converted
to type aliases,
node:import protocol,||to??, non-nullassertions replaced,
errcatch parameters renamed toerror, andother minor cleanups.
Two small unrelated fixes are bundled in:
process.exit(1)is now reached from both branches of the CLI'stop-level
.catch, so non-Errorrejections no longer exit zero.pack()passescwdtoexecinstead of mutatingprocess.cwd,removing a leak where a failed pack left the global cwd pointing
at the package source dir.
Decisions:
eslint/require-awaitandtypescript/require-awaitare off.They conflict with
promise-function-async+return-awaitforpure delegation functions, and
promise-function-asyncalreadyguards the property they protect.
pack()cwd fix, usedexec'scwdoption instead ofthe reviewer-suggested try/finally — eliminates the bug class
rather than patching it, and makes the function concurrency-safe.