36 Commits

Author SHA1 Message Date
3c6da3f241 i18n: removes useTranslate from ESLint rules (#106597)
* i18n: removes useTranslate from eslint rules

* chore: remove some more useTranslate
2025-06-12 13:30:54 +02:00
0879479c15 Internationalisation: Mark up @grafana/prometheus package (#105861)
* scaffolding for grafana-prometheus i18n

* markup

* extract translations

* fix tests

* add loadResources + fix object properties

* fix typo + prettier

* remove useTranslate

* update workflow to trigger on changes to grafana-sql/grafana-prometheus packages
2025-06-12 11:29:33 +01:00
84eafb9a56 Internationalisation: Mark up @grafana/sql package (#105842)
* scaffolding for package

* crowdin scaffolding

* markup

* add translations

* fix locale location

* fix tsconfig?

* undo bundler change

* object tranlsations, expose loadResources and call in mssql

* prettier

* remove useTranslate

* extract translations

* last couple of fixes

* remove deleted files
2025-06-12 10:52:04 +01:00
4ac248a512 Internationalisation: Mark up panel plugins for translations (#106068)
* config for panel plugin translations

* markup

* tweaks

* prettier

* use data-testid

* rename disable rule now it's been moved

* final markup
2025-05-29 18:13:25 +01:00
abb885c585 I18n: Move eslint rule to package (#105860) 2025-05-29 16:11:59 +02:00
7bfa78c6e6 I18n: Update eslint rule to catch some untranslated object properties (#105072) 2025-05-28 21:14:43 +01:00
ea0e49a6e6 Chore: Restrict imports of test files to avoid test pollution (#106057) 2025-05-28 10:37:15 +02:00
b1c1d080e2 Internationalisation: Mark up MSSQL (#105532)
* scaffolding

* markup

* fix typos + extract translations

* update crowdin.yml

* uppercase Grafana
2025-05-20 14:39:41 +01:00
c2ebb9cbbf i18n: Update lint rule suggested import location to @grafana/i18n (#105091) 2025-05-19 15:00:15 +01:00
aa0842a1e7 Internationalisation: Mark up azure monitor plugin (#105262)
* start marking up azuremonitor

* more markup

* finish mark up

* add package and correct imports

* convert to functional component + use correct t import

* fix duplicate key + typo

* add extract config + fake french translations to test

* run prettier and fix unit tests

* use nx

* enable i18n lint rules for azure monitor

* remove fake french translations

* await initPluginTranslations

* top level await breaks unit tests

* leave as class component for now
2025-05-15 13:31:49 +00:00
16668b993f Alerting: Enable alerting eslint overrides for package (#104678) 2025-05-14 20:30:52 +02:00
a9b6d098e9 Chore: Add eslint no-restricted-globals rule (#104519)
* Chore: Add no-restricted-globals eslint rule

* Fix eslint warnings

* Revert some changes

* Update

* Feedback
2025-05-12 12:38:26 +03:00
8f17f607fa FEMT: Add no-restricted-img-srcs rule (#105006) 2025-05-12 10:34:17 +01:00
e2cb3e74f3 Chore: Apply testing-library rules to grafana-ui package tests (#105140)
* Apply testing-library rules to grafana-ui package tests

* Apply auto fixes

* Fix eslint test issues in grafana-ui package

* Fix prettier issues

* Address review feedback
2025-05-09 17:45:33 +01:00
2a02fd7239 Chore: run i18n lint rules in enterprise as well (#105064)
run i18n lint rules in enterprise as well
2025-05-07 15:47:35 +01:00
6f3200d4f0 Re-enable jsx-a11y recommended rules (#104637)
* Re-enable `jsx-a11y` recommended rules

* apply rule in correct place, couple of fixes

* fix up some a11y issues

* add ignore for keyboard a11y for now

* readd testid

* close carousel on backdrop click

* use type="button"

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-05-07 15:43:48 +01:00
ec478138a5 Chore: Fix import/ordering for image imports (#105055) 2025-05-07 13:41:56 +03:00
b56a4a5295 Border radius: Improve rule and fix remaining violations (#104569)
* improve rule and fix remaining borderRadius violations

* prettier

* Add test case for nested classes

* Fix unnecessary string wrapping

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-30 14:03:54 +01:00
356c979328 Chore: Enable no-constant-condition eslint rule (#104298) 2025-04-24 09:50:29 +01:00
f9d2199b12 Alerting: Enable no-nested-ternary ESLint rule (#104085) 2025-04-23 11:00:40 +00:00
f9fb6f3b88 Chore: Update eslint configs to ignore /spec/ files when necessary (#104377) 2025-04-23 10:24:26 +01:00
fbb0bef368 Internationalisation: Ignore enterprise files for now (#104293)
ignore enterprise files for now
2025-04-22 11:40:06 -03:00
b052b28a88 Internationalisation: Enable i18n eslint rules (#104277)
* enable i18n rules by default

* commit translation changes
2025-04-22 13:56:25 +01:00
0860867b84 i18n: Fix all remaining alerting translation markup (#104103)
* alerting markup

* fix typo

* Fix remaining Alerting issues 🎉

* Enable no-untranslated-strings rule for alerting

* Fix i18n eslint rule for "fixed" areas of code

* Remove auto fixing

* kick CI

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2025-04-16 17:45:12 +01:00
f1470de478 Chore: Add eslint rule for empty files and tidy up (#102288)
* Add eslint rule for empty files

* Remove empty files
2025-03-17 14:54:12 +02:00
9870718c3a Alerting: Enable jsx-no-useless-fragment rule (#101884)
* Add no-useless-fragment rule for alerting code

* Auto-fix most no-useless-fragment cases

* Manually fix remaining no-useless-fragment cases

* Fix `invalid` passing to Field component

* Allow AlertingPageWrapper to have optional children
2025-03-11 22:31:47 +02:00
d198fa1dd0 Chore: add lint rule prevent t import from i18next (#99761)
* also handle i18next import

* fix violations
2025-01-29 15:46:13 +00:00
dea2e41e9f Grafana UI: Use Eslint no-restricted-imports in tests and stories (#99191)
* style(eslint): remove ignore from grafana/ui-overrides

* style(grafana-ui): update imports for tests

* style(grafana-ui): update imports for stories

* chore(betterer): update results file

* Fix useTheme import

* Change deprecated Horizontal/Vertical group usages

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-01-20 09:44:19 +01:00
f75bbe9f43 Alerting: Add self closing comp rule to alerting eslint config (#98603) 2025-01-09 10:02:52 +00:00
084aad0b84 Chore: Add no-duplicate-case eslint rule and fix violations (#97537)
* Add `no-duplicate-case` rule

* Fix basic duplicated cases

* Fix duplicated translations case

* Fix alerting case
2024-12-11 17:33:31 +00:00
4f7ffafe98 Alerting: Consistently order member imports in alerting code (#97688)
* Lint import member orders within alerting

* Consistently order member imports in alerting code
2024-12-10 17:42:33 +00:00
b105b32c8a Chore: Remove @eslint/compat and don't run all eslint rules in betterer (#97463)
* Remove eslint compat

* Remove fixup for testing library rules

* Make sure we don't ignore betterer eslint config from itself

* Update betterer to not run rules that are run in linting anyway
2024-12-05 12:14:09 +00:00
754fce648c Chore: Make Eslint work with enterprise (#96539)
chore(eslint): make it work with enterprise
2024-11-26 11:09:27 +01:00
7ae0d551fe Chore: Move betterer eslint rules to separate file and allow opting in (#96240)
* Move betterer eslint rules to separate file and allow opt-in for local dev

* Add betterer eslint to codeowners
2024-11-15 14:01:39 +00:00
cbe8b8a290 Alerting: Lint and remove unused object properties (#92996) 2024-11-11 13:02:46 +00:00
8c41137bcf Frontend: Update to Eslint 9 (#94823)
* chore(eslint): bump all eslint related packages to latest

* chore(eslint): update linting scripts work with v9

* chore(eslint): introduce flat config

* chore(eslint): delete legacy configs

* feat(grafana-eslint-rules): update rules to use eslint 9 APIs

* chore(eslint): migrate all nested eslintrc files over to root config

* chore(packages): bump eslint dependencies

* feat(betterer): make it work with eslint 9

* style(grafana-data): remove non-existant ban-types rule from disable declarations

* chore(wip): [wip] link eslint-config-grafana

* chore(packages): add @eslint/compat

* chore(eslint): add compat to testing library and fix alerting rules

* chore(eslint): bump grafana eslint-config to v8

* chore(explore): delete legacy eslint config

* chore: clean codeowners file, remove grafana/eslint-config from e2e plugins

* test(eslint-rules): fix no-border-radius-literal and no-aria-label-e2e-selectors rule tests

* Add .js to prettier checks so new eslint.config.js file isn't missed

* chore(eslint): move emotion/syntax-preference to grafana/defaults

* test(eslint): use core-js structured-clone

* revert(services): undo merge backend-format githook changes

* test(eslint-rules): remove structured-clone polyfill from tests

* chore(eslint): add back public/lib/monaco to ignore list, sort alphabetically

* chore(e2e-plugins): remove eslint config 7 from plugins package.json

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2024-11-07 16:31:06 +01:00