feat(eslint-config)!: upgrade typescript-eslint to v8 - #11811
Open
raymondfeng wants to merge 5 commits into
Open
raymondfeng wants to merge 5 commits into
raymondfeng wants to merge 5 commits into
Conversation
typescript-eslint v7 does not support TypeScript 6 or later, so it blocks the TypeScript upgrade. Rules that v8 renamed or split are disabled to keep the rule set this configuration already had: `no-require-imports` replaces `no-var-requires`, and `ban-types` is split into `no-empty-object-type`, `no-unsafe-function-type` and `no-wrapper-object-types`. `prefer-nullish-coalescing` now ignores primitive operands. The rule runs without `strictNullChecks`, so it cannot tell whether a `string`, `number` or `boolean` operand may be nullish, and v8 reports `||` on such operands, where switching to `??` changes the result for `''`, `0` and `false`. BREAKING CHANGE: `@loopback/eslint-config` requires `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` v8. Projects using it can get new findings, such as unused `catch` bindings (`no-unused-vars`), `prefer-optional-chain`, and `prefer-nullish-coalescing` for `if (x == null) x = y`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
- Drop unused `catch` bindings (`no-unused-vars`). - Use optional chains where they are equivalent (`prefer-optional-chain`). - Use `??=` for `if (x == null) x = y` and for `!x` guards on values that are objects or arrays, where it is equivalent (`prefer-nullish-coalescing`). - Remove the `route()` overload that `RestApplication` declared twice (`unified-signatures`). - Remove `eslint-disable` directives that no longer suppress anything. `||` is kept wherever the left operand may be `''` or `0`. The passport-login example keeps its explicit `!user.credentials` guard, since `user.credentials?.password !== password` accepts a user without credentials when `password` is `undefined`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
raymondfeng
requested review from
achrinza,
mschnee and
samarpanB
as code owners
October 2, 2026 05:02
6 of 8 tasks
The US Census geocoder now returns slightly different coordinates for the test address, so `GeoLookupService` and `TodoApplication` tests fail on every platform, on master as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
The hook that launches puppeteer and loads the page intermittently exceeds 15 seconds on the ubuntu-latest runners. It now gets 30 seconds, the same as the hook that generates the bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
4 of 8 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades typescript-eslint from v7 to v8, which TypeScript 6+ requires. Split out of #11793 so it can be reviewed and released on its own. #11793 builds on this PR.
Commits
feat(eslint-config)!: the dependency bump and rule config. This is the only commit withBREAKING CHANGE:, so lerna's conventional-commit bump makes a major release of@loopback/eslint-configonly.no-require-imports,no-empty-object-type,no-unsafe-function-type,no-wrapper-object-types).prefer-nullish-coalescingnow ignores primitive operands. Lint runs withoutstrictNullChecks(tsconfig.build.json), so v8 reports||even onstring/number/booleanoperands, where??changes the result for'',0andfalse. One example on master ischeck(value) || check(...)inrelation.helpers.ts, where both sides are booleans.feat(cli): generated projects use typescript-eslint v8.refactor:: fixes for the findings v8 reports on master with TypeScript 5.2:catchbindings??=for== nullguards and for!xguards on objects/arraysRestApplication.route()overloadeslint-disabledirectivesBehavior: this PR doesn't change it.
||is kept wherever the operand can be''or0. The passport-login example keeps its explicit!user.credentialsguard.Checklist
npm testpasses on your machine: build and lint pass. Mocha: 4492 passing, but the CLI generator tests can't run in a non-interactive shell, and the todo geocoder tests fail against live data, on master as well. Relying on CI for those.packages/cliwere updatedexamples/*were updated🤖 Generated with Claude Code