Commit Graph

19 Commits

Author SHA1 Message Date
Ashley Harrison 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
Tom Ratcliffe 356c979328
Chore: Enable `no-constant-condition` eslint rule (#104298) 2025-04-24 09:50:29 +01:00
Tom Ratcliffe f9d2199b12
Alerting: Enable `no-nested-ternary` ESLint rule (#104085) 2025-04-23 11:00:40 +00:00
Tom Ratcliffe f9fb6f3b88
Chore: Update eslint configs to ignore `/spec/` files when necessary (#104377) 2025-04-23 10:24:26 +01:00
Ashley Harrison fbb0bef368
Internationalisation: Ignore enterprise files for now (#104293)
ignore enterprise files for now
2025-04-22 11:40:06 -03:00
Ashley Harrison b052b28a88
Internationalisation: Enable i18n eslint rules (#104277)
* enable i18n rules by default

* commit translation changes
2025-04-22 13:56:25 +01:00
Tom Ratcliffe 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
Tom Ratcliffe 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
Tom Ratcliffe 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
Ashley Harrison 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
Jack Westbrook 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
Tom Ratcliffe f75bbe9f43
Alerting: Add self closing comp rule to alerting eslint config (#98603) 2025-01-09 10:02:52 +00:00
Tom Ratcliffe 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
Tom Ratcliffe 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
Tom Ratcliffe 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
Jack Westbrook 754fce648c
Chore: Make Eslint work with enterprise (#96539)
chore(eslint): make it work with enterprise
2024-11-26 11:09:27 +01:00
Tom Ratcliffe 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
Tom Ratcliffe cbe8b8a290
Alerting: Lint and remove unused object properties (#92996) 2024-11-11 13:02:46 +00:00
Jack Westbrook 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