Skip to content

Conversation

@velle
Copy link

@velle velle commented Oct 3, 2025

Background/motivation: Wanted to do a minor bug fix, but could not run build tools.
First attempted at minimally intrusive fixes, but ended up with a rather big overhaul.

Changes:

  • Migrated toolchain to Node 18 + TypeScript 5 (NodeNext, ES2020, @types/node)
  • Replaced TSLint with ESLint, fixed ~90 violations
  • Cleaned up (some) unused deps/devDeps, installed missing @inquirer/prompts
  • Upgraded vulnerable packages (inquirer → 12.9, nyc → 17.1)

Status:

  • npm pack works
  • npm test works (but test occasionally fails)
  • npm version works, will keep package-lock.json and README.md in sync

Remaining work

  • remove nyc, not meaningful with so low test coverage
  • migrate away from deprecated packages
  • remove remaining unused packages from package.json
  • stricter ESLint rules
  • add a few e2e tests in scrut
  • fix intermittent failing of login.test.ts

  - /usr/bin/tsc -> tsc
  - removed `-b` flag, only applicable for multi-project builds
 - npm i -D typescript@^5.4 @types/node@^18 tslib@^2.6
 - tsconfig:
   - "module":"NodeNext" # required from Node 18
   - "moduleResolution":"NodeNext"
   - "target":"ES2020" # Node18 recommends ES2020/ES2022
   - "types":["node"] # ensure Node globals; avoid accidental global typings from other @types

NodeNext is required from Node v.

Still does not pass tsc typecheck:
 - package code passes
 - dependencies fails, e.g. legacy oclif
Rewrote test hooks:
  - removed NODE_OPTIONS='--loader ts-node/esm', to fix ERR_REQUIRE_CYCLE_MODULE
  - split into three hooks: test:nyc, test:plain, test
  - renamed hook key `posttest` -> `lint`

Status / known issues:
  - npm test passes (but prints warning MODULE_TYPELESS_PACKAGE_JSON)
  - login.test.ts is intermittently failing (likely network/server latency).
    https://gist.github.com/velle/4f14d47d3c52031439f7affc5aae69b8
  - linting is broken, besides printing violations, tslint also prints its own warnings/errors
Changes:
- Removed deprecated TSLint, deprecated since 2019
- Added ESLint + @typescript-eslint + plugin-n + Prettier
- Added minimal eslint.config.cjs, no style check, only checks *.*ts
- Updated/created hooks: `lint` and `lint:fix`

Status/known issues:
- ESLint is minimal, very relaxed
- Still 90 violations (none fixed yet)
`npm version 2025.10.0` is now working again
@oclif/parser, @oclif/plugin-autocomplete, @oclif/plugin-update
dotenv, fetch-blob, through2, url-parse
…r":true, this is default behavior since npm11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant