# no-unnecessary-boolean-comparison πŸ“ Disallow unnecessary comparisons against boolean literals. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). Comparing a value that is already known to be boolean against `true` or `false` adds noise without changing the result. This rule only reports comparisons where the non-literal side is known to be boolean. It intentionally does not report unknown values like `value === true`, because strict identity comparison against `true` is not equivalent to a truthiness check. ## Examples ```js // ❌ if ((a > b) === true) {} // βœ… if (a > b) {} ``` ```js // ❌ if ((a > b) === false) {} // βœ… if (!(a > b)) {} ``` ```js // ❌ const active = Boolean(value) !== false; // βœ… const active = Boolean(value); ``` ```js // βœ… if (value === true) {} ```