grafana/packages/grafana-eslint-rules
renovate[bot] 51bc84673d
Update dependency eslint to v8.52.0 (#76946)
* Update dependency eslint to v8.52.0

* update sdk version

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-10-23 15:36:48 +03:00
..
rules GLDS: Check if tokens are used as borderRadius values (#71187) 2023-08-01 12:44:25 +02:00
tests Chore: add some basic validation tests for our eslint rules (#75284) 2023-09-22 13:03:21 +01:00
index.cjs GLDS: Check if tokens are used as borderRadius values (#71187) 2023-08-01 12:44:25 +02:00
LICENSE_APACHE2 Chore: eslint rule for preventing e2e selectors in aria-label (#59731) 2023-01-18 15:02:35 +00:00
package.json Update dependency eslint to v8.52.0 (#76946) 2023-10-23 15:36:48 +03:00
README.md ESLint: Fix typo in README (#75784) 2023-10-19 14:54:48 +02:00

Grafana ESLint Rules

This package contains custom eslint rules for use within the Grafana codebase only. They're extremley specific to our codebase, and are of little use to anyone else. They're not published to NPM, and are consumed through the Yarn workspace.

Rules

@grafana/no-aria-label-selectors

Require aria-label JSX properties to not include selectors from the @grafana/e2e-selectors package.

Previously we hijacked the aria-label property to use as E2E selectors as an attempt to "improve accessibility" while making this easier for testing. However, this lead to many elements having poor, verbose, and unnecessary labels.

Now, we prefer using data-testid for E2E selectors.

@grafana/no-border-radius-literal

Check if border-radius theme tokens are used.

To improve the consistency across Grafana we encourage devs to use tokens instead of custom values. In this case, we want the borderRadius to use the appropriate token such as theme.shape.radius.default, theme.shape.radius.pill or theme.shape.radius.circle.

@grafana/theme-token-usage

Used to find all instances of theme tokens being used in the codebase and emit the counts as metrics. Should not be used as an actual lint rule!