Repository navigation
style(eslint): enable prefer-nullish-coalescing rule - #12340
Conversation
…-nullish-coalescing-full # Conflicts: # eslint.config.mjs # src/data-source/DataSource.ts # src/driver/sqlserver/SqlServerDriver.ts # test/github-issues/5684/issue-5684.test.ts
commit: |
Code Review by Qodo
|
|
|
||
| const portUrlPart = | ||
| schemaUrlPart === "mongodb+srv" ? "" : `:${options.port || "27017"}` | ||
| schemaUrlPart === "mongodb+srv" ? "" : `:${options.port ?? "27017"}` |
There was a problem hiding this comment.
Do we have the default port for other DBs?
There was a problem hiding this comment.
Other drivers don't construct connection URLs manually — they pass options to their client libraries (e.g. pg, mysql2) which handle default ports internally. MongoDB is unique here because the driver builds the connection string by hand.
alumni
left a comment
There was a problem hiding this comment.
Prefer optional chaining would be great to have (IMO in the same PR)
- SelectQueryBuilder: rewrite cache enablement as ternary to preserve boolean OR semantics (false should fall through to per-query cache) - DriverUtils: normalize empty database string to undefined before ?? - RedisQueryResultCache: normalize empty identifier to undefined before ??
Already merged yesterday in #12331 :) |
|
Persistent review updated to latest commit 4d9d6de |
- JoinTable: simplify negated equality to !== operator - SpannerQueryRunner: flip negated condition to positive-first - test-utils: simplify ternary to optional chaining
|
|
Persistent review updated to latest commit aeeb8f8 |



Enable
@typescript-eslint/prefer-nullish-coalescingas suggested in #12255, replacing||with??/??=where the intent is null/undefined checking rather than falsy checking.