Skip to main content
The ESLint plugin requires ESLint v9+ (flat config) and Node 18+. It includes peer dependencies for TypeScript ESLint utilities.

Install with package managers

Peer dependencies

The plugin requires the following peer dependencies:
The plugin works with both JavaScript and TypeScript Gadget action files. You do not need to install @typescript-eslint/parser unless you are using other TypeScript-specific ESLint rules.

Verify installation

Check that the plugin is available:
Expected output:

Minimal config

Create eslint.config.js in your project root:
eslint.config.js
This enables all 16 rules with recommended severity levels (mix of error and warn).

Run ESLint

Lint your Gadget action files:
The plugin only activates rules on files matching Gadget action patterns:
  • **/api/actions/**/*.{js,ts} (global actions)
  • **/api/models/**/actions/**/*.{js,ts} (model actions)
The two enqueue rules (action-no-enqueue-max-concurrency-exceeded and action-no-implicit-enqueue-retries) apply to all files since api.enqueue() can be called anywhere.

Auto-fix issues

Many rules support auto-fixing:
Fixable rules include:
  • action-no-invalid-options - removes numeric separators, converts template literals to strings
  • action-no-invalid-timeout-ms - clamps timeout to 900000ms
  • action-require-timeout-ms-comment - adds trailing // N minutes comment
  • action-no-empty-on-success - removes empty onSuccess exports
  • action-require-action-run-type - adds ActionRun type annotations
See Configuration for advanced setup options.

Local development

If you are contributing to the plugin or testing unreleased changes, you can link it locally.
Re-run pnpm run build after making changes.

Using pnpm pack

Next steps

Configuration

Learn about file patterns and customizing rules

Configs

Compare recommended vs strict presets