Skip to content

Commit ce46f7a

Browse files
dr-itzspike-rabbit
authored andcommitted
feat(eslint-config-typescript): relax rule '@typescript-eslint/prefer-nullish-coalescing'
Relax the rule by enabling `ignorePrimitives`. Reason is that the rule suggest changes that break working code. E.g. `a || b` vs `a ?? b` is something completely different when `a` is a string or a number, yet the rule suggests the change.
1 parent 668824e commit ce46f7a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

eslint-config-typescript/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const configBase = typescriptEslint.config({
5858
'@typescript-eslint/no-unused-expressions': ['error'],
5959
'@typescript-eslint/prefer-for-of': ['error'],
6060
'@typescript-eslint/prefer-function-type': ['error'],
61+
'@typescript-eslint/prefer-nullish-coalescing': ['error', { ignorePrimitives: true }],
6162
'@typescript-eslint/unified-signatures': ['error'],
6263

6364
'no-duplicate-imports': ['error'],

0 commit comments

Comments
 (0)