> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0002 - Don't repeat negated patterns

> The negated pattern should not be repeated multiple times

Source: [AL0002DontRepeatNegatedPatternAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/AL0002DontRepeatNegatedPatternAnalyzer.cs)

## Description

The negated pattern should not be repeated multiple times.

## Bad Code

```csharp theme={null}
if (x is not null and not 0 and not 1)
```

## Good Code

```csharp theme={null}
if (x is not (null or 0 or 1))
```

## Properties

* **Category**: Design
* **Severity**: Warning
* **Enabled by default**: True
* **Code fix available**: True

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0002.severity = warning
```
