Conversation
ffdc7aa to
e672ad1
Compare
033d72f to
a60c280
Compare
a60c280 to
bc21bd5
Compare
| 'jest/no-conditional-expect': 'off', | ||
| 'vitest/no-conditional-expect': 'off', | ||
| 'jest/expect-expect': 'off', | ||
| 'vitest/expect-expect': 'off', | ||
| 'jest/no-standalone-expect': 'off', | ||
| 'vitest/no-standalone-expect': 'off', |
There was a problem hiding this comment.
Some of these rules seem reasonable - is there a reason why we are disabling these? I don't see their equivalents in the eslint setup.
There was a problem hiding this comment.
It might be all right in here, this is mostly based on apify-core where those triggered a lot of warnings due to false positives. I'll see if I can enable them here.
There was a problem hiding this comment.
Tested each — turned them on one at a time and counted violations:
| rule | violations | decision |
|---|---|---|
typescript/no-explicit-any |
148 | keep off (opt-in case-by-case) |
no-param-reassign |
40 | keep off |
typescript/no-empty-object-type |
4 | enable + fix |
typescript/no-unsafe-declaration-merging |
1 | enable + fix |
import/extensions |
0 | enable (free) |
no-empty-function |
n/a | preset already has it 'off', drop redundant override |
no-use-before-define |
2 | enable (preset config), fix |
no-void |
0 | preset enables with allowAsStatement: true, drop our override |
Pushed as a separate commit on top of this branch so you can see the diff. The fixes are mostly removing the empty-interface declaration-merging trick (no longer needed) and switching mutually-recursive listener arrows to function declarations.
There was a problem hiding this comment.
I meant mostly the jest/* and vitest/* rules, but it's cool we managed to shrink the main ruleset as well 👍
Replace @apify/eslint-config + ESLint with @apify/oxlint-config + oxlint
(plus oxlint-tsgolint for type-aware rules), mirroring the migration
already done in apify-storage-local-js and apify-core.
- Drop eslint, typescript-eslint, globals, @apify/eslint-config
- Add oxlint, oxlint-tsgolint, @apify/oxlint-config
- Replace eslint.config.mjs and test/.eslintrc with oxlint.config.ts
- Update lint / lint:fix scripts to use oxlint --type-aware
- Update lint-staged to call oxlint --fix
- Override module/moduleResolution to Node16 in tsconfig.json so
oxlint-tsgolint can parse it (build tsconfig stays on commonjs/node
for tsup compatibility)
- Replace stale `eslint-disable import-x/*` with the rules removed or
rewritten to oxlint's `import/*` and `typescript/*` plugin names
- Auto-fix surfaced issues: switch built-in imports to `node:` protocol,
drop dead Node 14 conditional in test/log.test.ts, fix `it('it works')`
duplicate prefix
- Allow intentional `\0` regex matches in BSON key escaping
bc21bd5 to
6898006
Compare
Most of the locally disabled rules were carried over from the apify-core config where they fire on a lot of pre-existing code. In this much smaller repo they're tractable. Enabled (preset/oxlint defaults take over): - typescript/no-empty-object-type (4 violations, all empty-interface tricks for recursive types or class+interface declaration merging) - typescript/no-unsafe-declaration-merging (1 violation, RetryableError class+interface merge — no longer needed) - import/extensions (0 violations, free win) - no-empty-function (preset already has it 'off' — drop redundant override) - no-use-before-define (preset config with safe options applies; 2 violations in promisifyServerListen fixed by switching the mutually recursive listeners to function declarations) - no-void (preset enables with allowAsStatement: true; no violations) Kept disabled: - typescript/no-explicit-any (148 violations — opt-in case-by-case) - no-param-reassign (40 violations — too many to clean up here)
6898006 to
c8e3902
Compare
Summary
Replaces ESLint with oxlint, pulling in the shared
@apify/oxlint-configpreset andoxlint-tsgolintfor type-aware rules. Mirrors the migration already shipped in apify-storage-local-js and apify-core.Stacked on top of #616 (pnpm migration). Will be retargeted to
masterafter #616 merges.What changed
eslint,typescript-eslint,globals,@apify/eslint-configoxlint@1.62.0,oxlint-tsgolint@0.22.0,@apify/oxlint-config@^0.2.5eslint.config.mjsandtest/.eslintrcwithoxlint.config.tslint/lint:fixnow runoxlint --type-awarelint-stagednow runsoxlint --fixtsconfig.jsonoverridesmodule/moduleResolutiontoNode16sooxlint-tsgolintcan parse it (build tsconfig stays oncommonjs/nodeso tsup keeps building correctly)import-x/*disable comments rewritten to oxlint'simport/*plugin or removed where the underlying rule has no oxlint counterpartnode:protocol, drop dead Node 14 conditional intest/log.test.ts, fix duplicate prefix init('it works')\0regex match in BSON key escaping (line-level disable)Lint output
Test plan
pnpm lint— cleanpnpm lint:fix— cleanpnpm test— 459/459 passingpnpm build— all 15 packages built