# consistent-assert πŸ“ Enforce consistent assertion style with `node:assert`. πŸ’ΌπŸš« 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). Prefer `assert.ok()` over `assert()` for its explicit intent and better readability. It aligns with other assert methods, ensuring consistency and making code easier to maintain and understand. ## Examples ```js import assert from 'node:assert/strict'; assert.strictEqual(actual, expected); assert.deepStrictEqual(actual, expected); // ❌ assert(divide(10, 2) === 5); // βœ… assert.ok(divide(10, 2) === 5); ``` ```js import assert from 'node:assert'; assert.strictEqual(actual, expected); assert.deepStrictEqual(actual, expected); // ❌ assert(divide(10, 2) === 5); // βœ… assert.ok(divide(10, 2) === 5); ``` ```js import {strict as assert} from 'node:assert'; assert.strictEqual(actual, expected); assert.deepStrictEqual(actual, expected); // ❌ assert(divide(10, 2) === 5); // βœ… assert.ok(divide(10, 2) === 5); ```