Enforces boolean types in conditional expressions for type safety
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377029 |
| Language Service name | strictBooleanExpressions |
| Oxlint name | effecttsgo/strict-boolean-expressions |
declare const value: string | undefined
export const preview = value ? 1 : 0
/**
^^^^^ effecttsgo(strict-boolean-expressions): Unexpected `string` type in condition, expected strictly a boolean instead.
*/
/**
^^^^^ effecttsgo(strict-boolean-expressions): Unexpected `undefined` type in condition, expected strictly a boolean instead.
*/See the Language Service setup guide for installation instructions.
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/strict-boolean-expressions": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "strictBooleanExpressions": "warning" } } ] } }