> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# eqeqeq

[Added in v0.4.1](https://github.com/web-infra-dev/rslint/releases/tag/v0.4.1)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'eqeqeq': 'error',
    },
  },
]);
```

## Rule Details

Requires the use of `===` and `!==` instead of `==` and `!=`. Using strict equality operators helps avoid unexpected type coercion in comparisons.

### Options

This rule supports three modes:

- `"always"` (default): Always require `===` and `!==`. Supports a `null` sub-option:
  - `"always"` (default): Enforce strict equality for null comparisons too
  - `"ignore"`: Skip enforcement for null comparisons
  - `"never"`: Enforce `==`/`!=` for null comparisons and `===`/`!==` for everything else
- `"smart"`: Allow `==` for typeof comparisons, same-type literal comparisons, and null checks
- `"allow-null"`: Shorthand for `["always", {"null": "ignore"}]`

Examples of **incorrect** code for this rule:

```javascript
a == b;
a != b;
typeof a == 'number'; // in "always" mode
```

Examples of **correct** code for this rule:

```javascript
a === b;
a !== b;
typeof a === 'number';

// With "smart" option:
typeof a == 'number';
null == a;
'hello' == 'world';

// With "allow-null" option:
a == null;
null != a;
```

## Original Documentation

- [ESLint: eqeqeq](https://eslint.org/docs/latest/rules/eqeqeq)
- [Source code](https://github.com/eslint/eslint/blob/v10.2.0/lib/rules/eqeqeq.js)
