You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,28 @@ foo ?? 'a string';
172
172
173
173
Also, if you would like to ignore all primitives types, you can set `ignorePrimitives: true`. It is equivalent to `ignorePrimitives: { string: true, number: true, bigint: true, boolean: true }`.
174
174
175
+
### `ignoreBooleanCoercion`
176
+
177
+
Whether to ignore expressions that coerce a value into a boolean: `Boolean(...)`.
178
+
179
+
Incorrect code for `ignoreBooleanCoercion: false`, and correct code for `ignoreBooleanCoercion: true`:
'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.',
73
74
},
75
+
ignoreBooleanCoercion: {
76
+
type: 'boolean',
77
+
description:
78
+
'Whether to ignore arguments to the `Boolean` constructor',
0 commit comments