---
title: "lint/operators"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Operators and their operands. Also in [format](/docs/rules/format/operators) (15) and [analyse](/docs/rules/analyse/operators) (15).

**[no-and-or-keywords](/docs/rules/lint/operators/no-and-or-keywords)**

Use `&&` and `||` logical operators instead of `and` and `or`.

In the `code-quality` set. Unsafe fix: it can change behaviour. Intent: suspicious.

**[no-error-suppression](/docs/rules/lint/operators/no-error-suppression)**

Error control operator should be added to deprecation notices and/or removed from other cases.

In the `code-quality` set. Unsafe fix: it can change behaviour. Intent: suspicious.

**[no-loose-equality](/docs/rules/lint/operators/no-loose-equality)**

Disallows the loose comparison operators `==` and `!=`; use `===` and `!==`.

In the `code-quality` set. Report only. Intent: suspicious. Upstream gates: `strictRules.disallowedLooseComparison`.

**[no-useless-nullsafe](/docs/rules/lint/operators/no-useless-nullsafe)**

There should not be useless Null-safe operator `?->` used.

In the `dead-code` set. Safe fix.

**[prefer-coalesce](/docs/rules/lint/operators/prefer-coalesce)**

Use `null` coalescing operator `??` where possible.

In the `modernize` set. Safe fix.

**[prefer-coalesce-assign](/docs/rules/lint/operators/prefer-coalesce-assign)**

Use the null coalescing assignment operator `??=` where possible.

In the `modernize` set. Safe fix.

**[prefer-coalesce-assign-over-fallback](/docs/rules/lint/operators/prefer-coalesce-assign-over-fallback)**

Suggests the null coalescing assignment operator (`??=`) when the right operand of `??` assigns to the same variable or property as its left operand.

In the `modernize` set. Safe fix where types prove it, unsafe otherwise.
