Commit Graph

37 Commits

Author SHA1 Message Date
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
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
Ashley Harrison
55673e2f41
Chore: Add emotion object syntax rule to eslint (#95429)
add object syntax rule to eslint
2024-10-28 13:47:46 +00:00
Ashley Harrison
161d452841
Chore: Type improvements (#93267)
* some type fixes + ignore graveyard folder

* few more fixes

* remove comment

* ignore global styles

* few more type fixes
2024-09-13 09:50:55 +01:00
Erik Sundell
d8ec95e9b1
E2E: Add support for building test plugins (#91873)
* build test apps with webpack

* add extensions test app

* update e2e tests

* remove non-build test apps using amd

* use @grafana/plugin-configs rather than create-plugin config

* Update e2e/plugin-e2e/plugin-e2e-api-tests/as-admin-user/extensions/usePluginComponents.spec.ts

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>

* Update package.json

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>

* use run dir variable instead of hardcoded path

* add dummy licence file

* add separate step for building test plugins

* support nested plugins

* remove react-router-dom from the externals array

* remove add_mode dev

* lint starlark

* pass license path as env variable

* fix the path

* chore(e2e-plugins): clean up dependencies to match core versions

* refactor(e2e-plugins): prefer extending webpack plugins-config

* docs(e2e-plugins): add basic info to extensions test plugin readme

* update readme

* change dir name from custom plugins to test plugins

* change root readme

* update lockfile

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2024-08-23 09:00:03 +02:00
Laura Fernández
98dcb3818c
Chore: Add no-untranslated-strings rule to betterer (#88479) 2024-05-30 12:45:22 +02:00
Josh Hunt
5190e68ab1
Chore: Refactor betterer eslint to use overrides (#88442)
* Chore: Refactor betterer eslint to use overrides

* more comments
2024-05-30 10:09:30 +01:00
Erik Sundell
a3ef463499
Grafana packages: Remove E2E workspace (#86416)
* remove e2e package code and any code referencing it

* update code owners

* remove more references to e2e package

* remove unrelated file
2024-04-25 07:12:43 +02:00
Jack Westbrook
1dfd34ee79
Chore: Add codemod and betterer config to make barrel imports explicit (#80913)
* chore: add codemod for highlighting barrel imports

* style(frontend): add no-barrel-files plugin to betterer

* chore(betterer): update betterer file

* ci(frontend-metrics): track occurrences of barrel files being imported

* chore: clean up explicit barrel imports codemod script

* chore(codeowners): add explicit barrel imports script

* Add no-barrel-files plugin to betterer configuration

Co-Authored-By: LeventeBalogh <balogh.levente.hu@gmail.com>

---------

Co-authored-by: LeventeBalogh <balogh.levente.hu@gmail.com>
2024-04-15 16:36:19 +02:00
Laura Fernández
cd43308dc9
Betterer: improve the deprecated layout components usage tracking (#85648) 2024-04-05 13:40:46 +02:00
Laura Fernández
2e8fb1aa56
Betterer: Track deprecated layout components usage (#85574) 2024-04-04 15:40:52 +02:00
Ashley Harrison
ffb9a4de4a
Chore: some test type fixes (#82889)
* some test type fixes

* ignore table-old since it's an angular panel that will be removed
2024-02-16 14:35:26 +00:00
Alex Khomenko
df8250ff48
Card: Remove mdx file and render docs from the story (#82565)
* Card: Generate docs from the story

* Update sort

* Update betterer to check for the "autodocs" tag
2024-02-16 13:13:50 +02:00
Tobias Skarhed
8d529bc4cb
Betterer: Add our own regexp matcher (#79448)
* Add betterer rule for gf-form

* Betterer: Write generic regexp matcher

* Add space

* Update lockfile

* Update comments

* Add comment with notice
2023-12-15 12:12:56 +02:00
Ashley Harrison
a221ebf7cc
Revert "Betterer: Add rule for gf-form (#79303)" (#79445)
This reverts commit 7a38a5ab1d.
2023-12-13 12:26:17 +01:00
Tobias Skarhed
7a38a5ab1d
Betterer: Add rule for gf-form (#79303)
Add betterer rule for gf-form
2023-12-13 11:35:57 +01:00
Ashley Harrison
171e2c1adb
Chore: Improve typings and ignore Graph (#75742)
* fix some types, ignore graph plugin as it'll be gone soon

* update comments

* more more more

* undo renderer change

* use Partial in the editor
2023-10-06 11:48:15 +01:00
Jack Westbrook
9052c2477d
Style: Add emotion/syntax-preference to betterer (#75266)
* style(betterer): add emotion/syntax-preference to betterer rules

* chore(betterer): refresh betterer.results for addition of emotion/syntax-preference
2023-09-22 12:41:09 +03:00
Ashley Harrison
0f2f25c5d9
Chore: Move to Cypress 12 and decouple cypress from @grafana/e2e (#74084)
* update drone to use cypress 12 image

* upgrade cypress to 12 in core

* cypress config actually valid

* update @grafana/e2e imports and add lint rule

* ignore grafana-e2e from betterer now it's deprecated

* fix remaining type errors

* fix failing tests

* remove unnecessary tsconfig

* remove unnecessary comment

* update enterprise suite commands to work

* add cypress config to CODEOWNERS

* export setTimeRange in utils

* remove @grafana/e2e from core deps

* try running the command through yarn

* move CMD to scripts

* Update cloud-data-sources e2e image

* Update paths

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-09-08 16:51:59 +01:00
renovate[bot]
95620cdd34
Update dependency glob to v10 (#71554)
* Update dependency glob to v10

* use named import

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-07-13 17:07:10 +03:00
Jack Westbrook
33ba5310ab
Chore: Upgrade Storybook to v7 (#65943)
* chore(grafana-ui): begin migration to storybook7

* refactor(storybook): begin cleanup of storybook and addon configs

* chore(storybook): add storybook/blocks to keep yarn berry happy

* chore(storybook): rename intro story for storybook 7

* chore(stories): rename internal stories to support SB7 story name mapper

* chore(betterer): update glob to support internal story renaming

* chore(stories): silence TS errors for subcomponents in SB7

* fix(clickoutsidewrapper): window | document can be undefined not null

* chore(storybook): remove patch for 6.5.16

* revert(storybook): put back story globs

* docs(storybook): replace removed <Props /> with <ArgsTypes /> in mdx files

* docs(storybook): use ArgTypes instead of ArgsTable

* chore(storybook): use correct ArgTypes import name in mdx files

* chore(storybook): patch blocks to expose Preview component for docs

* chore(storybook): rename deprecated ComponentStory and ComponentMeta for v7

* feat(storybook): add STORY env var to customise which stories storybook should load

* chore(storybook): bump to 7.0.4

* fix(storybook): set esbuild minify target to fix erroring docs in production builds

* fix(toolbarbuttonrow): fix import path to prevent error in storybook doc

* docs(storybook): fix up some more stories

* chore(storybook): more config updates to match storybook documentation

* chore(storybook): bump to 7.0.5

* Apply suggestions from code review

Co-authored-by: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com>

* chore(storybook): fix broken merge causing types issues

* chore(storybook): mimic broken alphabetical storySort and docs overview ordering

* docs(storybook): fix button docs adding p tags due to mdx2

* chore(storybook): bump to 7.0.10

* chore(storybook): apply patch on yarn install

* chore(text): update stories for storybook 7

* fix(storybook): make sure globs don't include internal stories in production

---------

Co-authored-by: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com>
2023-05-11 14:26:12 +02:00
Laura Fernández
ce1298c947
Storybook: update Alert story (#63959) 2023-03-30 18:11:30 +02:00
Ashley Harrison
5d60dd08d0
Chore: Ignore the angular dir from betterer (#65531)
ignore the angular dir from betterer
2023-03-29 16:02:53 +01:00
renovate[bot]
a227f69bed
Update dependency glob to v9 (#64016)
* Update dependency glob to v9

* update usage of glob

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-03-02 12:59:34 +00:00
Ashley Harrison
92a750a732
Chore: convert last test to RTL and remove Enzyme references (#61918)
convert last test to RTL and remove enzyme references
2023-01-24 09:20:47 +00:00
Josh Hunt
959c89793f
Chore: eslint rule for preventing e2e selectors in aria-label (#59731)
* Create eslint plugin/rule for catching e2e selectors in aria-label

* Add no-aria-label-e2e-selectors to betterer

* chore: skip levitate for the `grafana-eslint-rules` package

* Fix rule

* Add readme

* Add Apache 2 license

* Typecheck using @typescript-eslint/utils

* actually export the rule

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-01-18 15:02:35 +00:00
Esteban Beltran
a7a2c0f373
Linting: Speed up betterer by sharing eslint instances by groups (#60019) 2022-12-09 09:18:19 +01:00
Ashley Harrison
191ca1df86
Chore: some type fixes (#59030)
some type fixes
2022-11-29 15:52:08 +00:00
Josh Hunt
44ea98b24f
Chore: Ignore type assertions in __mocks__ (#53593) 2022-08-11 14:06:15 +00:00
Ashley Harrison
986b766ca0
Chore: Make betterer tests more stable (#51703)
* rewrite eslint test to not care about position of errors

* changing file contents shouldn't require a betterer.results update

* fix up eslint test

* fix the undocumented stories test

* ignore .test.ts files as well
2022-07-04 12:13:20 +01:00
Ashley Harrison
67802e64e6
keep the betterer message generic (#51563) 2022-06-29 15:57:49 +01:00
Ashley Harrison
688164bbd6
Chore: add a betterer test for undocumented stories (#51444)
* add a betterer test for undocumented stories

* update results

* Update .betterer.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* update results

* prettier

* slightly nicer regexp

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-06-29 12:25:31 +01:00
Ashley Harrison
0124dc8e6b
Chore: reintroduce type assertion test + change emitted metric names (#51375)
* reintroduce type assertion test + change emitted metric names

* rename test to better eslint to be more generic
2022-06-25 07:45:38 -04:00
Ashley Harrison
fa466e2134
Chore: comment out type assertions check due to bug (#51371)
* comment out type assertions check due to bug

* forgot to push the merge 🤦
2022-06-24 11:56:31 +01:00
Ashley Harrison
ded3d53d89
Chore: Additional betterer tests for type assertions and explicit any (#45901)
* Add betterer tests to prevent adding more type assertions and explicit any's into the codebase

* update betterer results file

* better glob matching

* updated results

* update results again...

* use more up to date betterer packages

* they're devdeps...

* Commit latest betterer results

* latest .betterer.results

Co-authored-by: joshhunt <josh@trtr.co>
2022-06-23 11:36:20 +01:00
Jack Westbrook
9b5a42845d
Chore: Remove prettier-plugin from ESLint (#45910)
* chore(eslint): remove prettier-plugin

* chore(eslint): test changes by using grafana/eslint 3.0.0-alpha

* chore(prettier): add js,ts,tsx when checking / writing

* chore(prettier): dont check js files

* chore(linting): align prettier and eslint ignore files

* style: run prettier:write on FE codebase

* chore(eslint): use grafana/eslint-config@3.0.0
2022-03-04 10:49:50 +01:00
Ashley Harrison
d3d7411e36
Chore: Add betterer test to track conversion of enzyme tests (#45055)
* Add betterer test for number of enzyme tests

* emit metric for number of enzyme tests

* update frontend metrics script

* Merge...

* Switch order of betterer/lint

* Update version of betterer

* kick levitate

* Update lockfile
2022-02-09 12:41:39 +00:00