Open-Source Wikis

/

Grafana

/

Packages

/

@grafana/eslint-plugin

grafana/grafana

@grafana/eslint-plugin

Custom ESLint rules. Source under packages/grafana-eslint-rules/.

The package is published as @grafana/eslint-plugin (note the rename) and consumed by the root eslint.config.js plus by external plugin authors who want to enforce Grafana's conventions.

Notable rules

Rule Enforces
theme-token-usage All colors must come from theme tokens, not raw literals
no-untranslated-strings User-visible strings must be wrapped in <Trans> / t()
no-restricted-img-srcs Images must come from approved hosts
import-order A Grafana-specific import/order config
Accessibility helpers Catches missing aria-* on interactive elements

The rules are written in TypeScript using the @typescript-eslint/utils AST API. New rules are added when a class of bug is found often enough to warrant automation.

Suppressions file

The repo has an eslint-suppressions.json (>100 KB) — a baseline of pre-existing violations that newer code is expected to avoid. New violations fail CI. The list is whittled down over time via yarn lint:prune.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

@grafana/eslint-plugin – Grafana wiki | Factory