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

# How rules apply

> Which files the Gadget ESLint plugin inspects and how rule scope is determined by file path.

The plugin does not lint every file. Most rules activate only on Gadget action file paths, so they stay silent in the rest of your codebase.

## File path detection

The plugin matches file paths using these glob patterns:

| Pattern                                 | Matches             |
| --------------------------------------- | ------------------- |
| `**/api/actions/**/*.{js,ts}`           | Global action files |
| `**/api/models/**/actions/**/*.{js,ts}` | Model action files  |

A file matching either pattern is considered a "Gadget action file." Windows backslash paths are normalized before matching.

## Scope by rule prefix

| Rule prefix       | Applies to                                        |
| ----------------- | ------------------------------------------------- |
| `action-*`        | All Gadget action files (global and model)        |
| `model-action-*`  | Model action files only (`api/models/**/actions`) |
| `global-action-*` | Global action files only (`api/actions`)          |
| Enqueue rules     | Any file that contains `api.enqueue(...)` calls   |

<Note>Each rule reference page includes a **Scope** label so you can see exactly where it applies.</Note>

## Why enqueue rules apply everywhere

The two enqueue rules - `action-no-enqueue-max-concurrency-exceeded` and `action-no-implicit-enqueue-retries` - inspect `api.enqueue(...)` call expressions directly. They apply to all files because enqueue calls can appear in utility modules, route handlers, or background jobs outside the standard action directories.

## Examples

```
my-gadget-app/
  api/
    actions/
      sendEmail.ts          # global action - matched by action-* and global-action-* rules
    models/
      user/
        actions/
          create.ts         # model action - matched by action-* and model-action-* rules
          update.ts         # model action
  src/
    utils/
      queue-helper.ts       # not an action file, but enqueue rules still apply here
```
