Commit Graph

44 Commits

Author SHA1 Message Date
Torkel Ödegaard
f6f3d97288
Eslint: Remove scenes rule for member accessability (#71087) 2023-07-06 09:22:02 +02:00
Ashley Harrison
7a2a5dde8b
Chore: Enable remaining jsx-a11y rules (#70990)
enabling remaining a11y rules + ignore existing violations
2023-06-30 16:58:16 +01: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
Laura Fernández
45d3125919
OptionsUI: SliderValueEditor does not get auto focused on slider change (#59209) 2022-11-24 18:21:33 +01:00
Torkel Ödegaard
1fb37b54b3
Scenes: Enforce explicit accessibility modifiers (ESLint) (#58331)
* Public test

* Update

* Update

* revert

* Added some public accessability modifiers

* Force public acessability only for scenes/* folder

* Fixes
2022-11-07 15:32:02 +01:00
Ashley Harrison
514d3111f4
Accessibility: Enable rule jsx-a11y/no-noninteractive-element-interactions (#58077)
* fixes for no-noninteractive-element-interactions

* remaining fixes

* add type="button"

* fix unit tests
2022-11-03 10:55:58 +00:00
Ashley Harrison
f76ba90078
Accessibility: Enable jsx-a11y/mouse-events-have-key-events (#58050)
* implement VizLegend keyboard accessibility

* add onBlur/onFocus
2022-11-03 10:22:50 +00:00
renovate[bot]
909d0f4ced
Update Monthly patch updates (#58002)
* Update Monthly patch updates

* update typescript sdk, add ignore for emotion css prop

* fix unit tests

* type fixes

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-11-02 12:05:32 +00:00
Ashley Harrison
e5c68f40c2
Accessibility: enable rule jsx-a11y/label-has-associated-control (#57964)
* use labels correctly

* fix opentsdb labels

* fix unit tests

* use aria-label instead of data-testid
2022-11-01 14:37:58 +00:00
Ashley Harrison
7e631e7239
A11y: Enable jsx-a11y/interactive-supports-focus (#57391)
* first batch of fixes for interactive-supports-focus

* remove role and aria attributes since this won't be focusable to a screenreader anyway
2022-10-21 13:52:46 +01:00
Laura Fernández
e402a8f27d
A11y: enable rule jsx-a11y/anchor-is-valid (#56690) 2022-10-21 09:13:32 +02:00
Ashley Harrison
a904372269
Accessibility: enable rule jsx-a11y/no-noninteractive-element-to-interactive-role (#56870)
* enable rule `jsx-a11y/no-noninteractive-element-to-interactive-role` and switch to extending recommended preset

* fix unit tests

* better unit test
2022-10-14 11:02:01 +01:00
Josh Hunt
891f9c00a1
I18n: Add lint rule to enforce correct i18n imports (#56487)
* I18n: Add lint rule to enforce correct i18n imports

* ignore in gui wrapper
2022-10-07 11:46:28 +01:00
Ashley Harrison
d293055ef6
enable rule jsx-a11y/iframe-has-title (#56292) 2022-10-04 16:04:28 +01:00
Ashley Harrison
e942a3d99d
enable jsx-a11y/no-autofocus (#56288) 2022-10-04 12:54:14 +01:00
Laura Fernández
fca252e7dc
A11y: enable rule jsx-a11y/alt-text (#55832)
* Enable jsx-a11y/alt-text rule

* Fix errors

* Fix tests

* Enable jsx-a11y/alt-text rule after solving merge conflict

* Delete unused import

* Modify files according to the reviewer's comments

* Revert test changes and update snapshot

* tweaks to image alt names

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-10-03 09:27:04 +01:00
Ashley Harrison
5b1fdd535a
Accessibility: turn on jsx-a11y/no-noninteractive-tabindex + fix/ignore errors (#56084)
* turn on jsx-a11y/no-noninteractive-tabindex + fix/ignore errors

* update comments
2022-09-30 13:20:39 +01:00
Ashley Harrison
97f1524b66
Chore: move the a11y rules to the overrides section so they don't apply to t… (#55848)
* move the a11y rules to the overrides section so they don't apply to tests

* turn alt-text back off
2022-09-27 16:59:35 +01:00
Ashley Harrison
11eb02a183
enable rule role-has-required-aria-props (#55841) 2022-09-27 11:17:26 -04:00
Ashley Harrison
527c00dae5
enable rule jsx-a11y/role-supports-aria-props (#55839) 2022-09-27 15:42:46 +01:00
Ashley Harrison
422b22a513
enable img-redundant-alt rule (#55833) 2022-09-27 10:26:32 -04:00
Ashley Harrison
afdb094983
turn on tabindex-no-positive rule (#55830) 2022-09-27 15:18:24 +01:00
Laura Fernández
4544494058
A11y: enable rule jsx-a11y/aria-role (#55760) 2022-09-27 10:55:16 +02:00
Ashley Harrison
80c49688a1
turn on all the rules that are working anyway (#55679) 2022-09-23 09:18:23 -04:00
Ashley Harrison
717e9b0a34
add eslint-plugin-jsx-a11y (#55677) 2022-09-23 14:02:16 +01:00
kay delaney
64bbb7a7ce
Chore: Update and enforce usage of typed react-redux hooks (#55349)
* Chore: Update and enforce usage of typed react-redux hooks
2022-09-19 10:49:35 +01:00
Josh Hunt
4b4d546e32
Typed variables pt4: Remove generics from getVariable (#53017)
* wip

* make diff easier to read

* Update template_srv getVariables to return new TypedVariableModel

* update VariableType to use the type from TypedVariableModel

* tidy things up

* Chore: Use type-accurate mock variables in tests

* Chore: Type VariableState to use TypedVariableModel

* fix typo

* remove type assertion from template_srv.getVariables

* use typescript/no-redeclare for compatibility with ts overloads

* remove generics from getVariable() and overload it to only return undefined based on arguments

* update usages of getVariable()

* Fix Interval variable options picker not working
2022-08-05 13:44:52 +01:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
Connor Lindsey
cd05ee0054
Chore: Prevent focused tests by adding jest eslint rule (#45088)
* Prevent focused tests by adding jest eslint rule

* Remove redundant no-only-tests eslint plugin

* Update lock file
2022-02-11 15:59:30 +01:00
kay delaney
bad048b7ba
Performance: Standardize lodash imports to use destructured members (#33040)
* Performance: Standardize lodash imports to use destructured members
Changes lodash imports of the form `import x from 'lodash/x'` to
`import { x } from 'lodash'` to reduce bundle size.

* Remove unnecessary _ import from Graph component

* Enforce lodash import style

* Fix remaining lodash imports
2021-04-21 09:38:00 +02:00
Torkel Ödegaard
2f3ef69b30
Buttons: Refactor & use new theme (#32767)
* WIP button styles refactoring

* Starting to work

* Tweak form disabled color

* Emotion performance tests

* More benchmarks

* added classnames prop

* Button class names refactor test

* revert to old style generation

* Wrapping up

* Updates

* Updated tests
2021-04-08 13:00:58 +02:00
Torkel Ödegaard
10badea19e
Emotion: Upgrades emotion from 10 to 11 and updates all import paths (#32541)
* Babel: Updates babel dependencies to latest version

* Emotion: Upgrade form 10 to 11

* Fixing tests

* Updated to use emotion/css instead in test
2021-04-01 14:15:23 +02:00
Zoltán Bedi
8232b6ebbc
Chore: eslint react hook fix for public folder (#31174)
* Fixes under public/app/plugins

* Fixes under public/app/plugins/datasource

* Fixes under public/app/features

* Fixes under public/app/features

* Fixes under public/app/features

* Fixes under public/app/components

* Fix PanelNotSupported test

* Fix one more warning

* Fix warning in usePanelSave

* Fix traceview empty response

* Azure monitor fixes

* More fixes

* Fix tests for azure monitor

* Fixes after merging master

* Add comment for disabled rules

* Fixes after merging master

* Fixes after merging master

* Adress review comments

* Fix azure tests

* Address review feedbacks
2021-03-25 12:42:14 +01:00
Zoltán Bedi
c8deaeacce
Chore: Fix eslint react hook warnings in grafana-ui (#31092)
* Chore: Fix eslint react hook warnings in grafana-ui

* Remove unneeded exlcudes

* Address Andrej's review
2021-02-24 17:21:47 +01:00
Zoltán Bedi
202f88c610
Chore: Lint all files for no-only-tests (#30364) 2021-01-19 11:06:27 +01:00
Chi-Hsuan Huang
73518bf1e7
Chore: Enable remaining eslint-plugin-react rules (#29519)
* Chore: Enable eslint react/no-render-return-value rule

Eanble the rule and remove the unused render return

part of: #29201

* Chore: Enable eslint react/no-children-prop rule

Not linting issues after turning on this. No other file changes requried

part of: #29201

* Chore: Enable eslint react/no-unknown-property rule

Correct enable-background to enableBackground

part of: #29201

* Chore: Enable eslint react/no-unescaped-entities rule

Replaced " with &quot; replaced ' with &apos;

part of: #29201
2020-12-02 10:03:37 +01:00
Chi-Hsuan Huang
546f569e0c
Chore: Enable eslint-plugin-react partial rules (#29428)
* Chore: Enable eslint react/display-name

Enable react/display-name and fixed the corresponding linting issue

part of: #29201

* Chore: Enable eslint react/no-deprecated

Enable react/no-deprecated and add the UNSAFE_ prefix for deprected methods

part of: #29201

* Chore: Enable eslint react/no-find-dom-node

Enable react/no-find-dom-node rule and use ref instead

part of: #29201

* Test: Update TeamGroupSync test snapshot

Since we added the displayName for ToolTip compontent and tag name is changed.

* Fix: Fixed ClickOutsideWrapper render

The props.children might contains numbers of nodes which make cloneElement failed. Change to simply use a div to wrapper
the children and assign the ref to div for this feature

* Style: Use shorthand method definition style for inline component

* Fix: Rebase master and fix linting

Rebase from master branch and fix new displayName linting warning
2020-12-01 16:19:52 +01:00
Torkel Ödegaard
dc93749287
Grunt: Removes grunt dependency and replaces some of its usage (#29461)
* Grunt: Removes grunt dependency and replaces some of it usage with alternatives

* Removed precommit toolkit task

* Fixed toolkit import

* Some cleanup of unused / not working stuff in build.go

* Removed sass errors
2020-12-01 10:32:12 +01:00
Dominik Prokop
0cfb967404
ESlint: React fixes part 1 (#29062)
* Eslint: allign with latest grafana-eslint-config

* fix ts

* Fix react/jsx-key

* Fix react/no-children-prop

* Fix react/jsx-no-target-blank
2020-11-18 15:36:35 +01:00
Dominik Prokop
5ae7280249
Introduce eslint-plugin-react (#29053)
* Eslint: allign with latest grafana-eslint-config

* fix ts

* Bump @grafana-eslint-congig version
2020-11-18 14:19:33 +01:00
Zoltán Bedi
b00755a2d9
Fix errors in grafana-ui's storybook files (#28004) 2020-10-03 11:53:01 +02:00
Zoltán Bedi
b98c85d81c
Chore: eslint plugin react hooks fix in jeager (#27580)
* Use eslintignore instead of gitignore

* Fix jaeger errors
2020-09-24 14:41:57 +02:00
Zoltán Bedi
ae30482465
Chore: MEGA - Make Eslint Great Again 💅 (#26094)
* Fix lint error in types.ts

* Bump eslint and its deps to latest

* Add eslintignore and remove not needed eslintrcs

* Change webpack configs eslint config

* Update package.jsons and removed unused eslintrc files

* Chore yarn lint --fix 💅

* Add devenv to eslintignore

* Remove eslint disable comments for rules that are not used

* Remaining eslint fixes 💅

* Bump grafana/eslint-config 💥

* Modify package.json

No need for duplicate checks.

* Modify eslintignore to ignore data and dist folders

* Revert removing .eslintrc to make sure not to use certain packages

* Modify package.json to remove not needed command

* Use gitignore for ignoring paths
2020-08-11 17:52:44 +02:00
Steven Vachon
f48169633c
TSLint → ESLint (#21006)
* Alphabetized tslint and tsconfig files

* Optimized tsconfig files

* Optimized editorconfig & prettier config files

… to reduce redundancy

* Switched to @grafana/tsconfig

… and:
* de-duped options
* removed options with default values

* Fixed nasty issue with types for nested slate-react

* Replaced TSLint with ESLint

* TSLint disables → ESLint disables

… also JSHint removals, which haven’t had an affect since it was replaced with TSLint.

* Compliances for ESLint, Prettier and TypeScript

* Updated lockfile
2020-02-08 02:40:04 +01:00