From 159fb4cebba90740c86f8f1deb74b62e45dc5b46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 11:11:27 +0000 Subject: [PATCH] Update dependency eslint-plugin-react to v7.27.1 (#43207) * Update dependency eslint-plugin-react to v7.27.1 * Fix up code to work with new version of eslint-plugin-react * kick drone Co-authored-by: Renovate Bot Co-authored-by: Ashley Harrison --- package.json | 2 +- .../src/components/Button/ToolbarButton.tsx | 2 + .../components/Select/IndicatorsContainer.tsx | 2 + .../Typeahead/PartialHighlighter.tsx | 13 ++-- .../ValueMatchers/RangeMatcherEditor.tsx | 2 +- .../DashboardPrompt/DashboardPrompt.tsx | 2 + .../PanelEditor/OptionsPaneCategory.tsx | 2 + .../explore/TraceView/createSpanLink.tsx | 4 +- .../search/components/ManageDashboards.tsx | 2 + .../components/PromExploreExtraField.tsx | 2 + yarn.lock | 70 ++++++++++++++++--- 11 files changed, 86 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index d96580a1e2f..587f777b7ef 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,7 @@ "eslint-plugin-lodash": "^7.2.0", "eslint-plugin-no-only-tests": "2.6.0", "eslint-plugin-prettier": "4.0.0", - "eslint-plugin-react": "7.22.0", + "eslint-plugin-react": "7.27.1", "eslint-plugin-react-hooks": "4.2.0", "eslint-webpack-plugin": "3.1.0", "expose-loader": "3.1.0", diff --git a/packages/grafana-ui/src/components/Button/ToolbarButton.tsx b/packages/grafana-ui/src/components/Button/ToolbarButton.tsx index 44c2536800a..84eb8c0b513 100644 --- a/packages/grafana-ui/src/components/Button/ToolbarButton.tsx +++ b/packages/grafana-ui/src/components/Button/ToolbarButton.tsx @@ -97,6 +97,8 @@ export const ToolbarButton = forwardRef( } ); +ToolbarButton.displayName = 'ToolbarButton'; + function getButtonAriaLabel(ariaLabel: string | undefined, tooltip: string | undefined) { return ariaLabel ? ariaLabel : tooltip ? selectors.components.PageToolbar.item(tooltip) : undefined; } diff --git a/packages/grafana-ui/src/components/Select/IndicatorsContainer.tsx b/packages/grafana-ui/src/components/Select/IndicatorsContainer.tsx index 094906cb98d..35ef549b262 100644 --- a/packages/grafana-ui/src/components/Select/IndicatorsContainer.tsx +++ b/packages/grafana-ui/src/components/Select/IndicatorsContainer.tsx @@ -22,3 +22,5 @@ export const IndicatorsContainer = React.forwardRef ); }); + +IndicatorsContainer.displayName = 'IndicatorsContainer'; diff --git a/packages/grafana-ui/src/components/Typeahead/PartialHighlighter.tsx b/packages/grafana-ui/src/components/Typeahead/PartialHighlighter.tsx index bcd095dd076..04e967b3b7e 100644 --- a/packages/grafana-ui/src/components/Typeahead/PartialHighlighter.tsx +++ b/packages/grafana-ui/src/components/Typeahead/PartialHighlighter.tsx @@ -42,11 +42,14 @@ export const PartialHighlighter: React.FC = (props: Props) => { let end = indices[i]; children.push( - createElement(highlighted ? 'mark' : 'span', { - key: i - 1, - children: text.substring(start, end), - className: highlighted ? highlightClassName : undefined, - }) + createElement( + highlighted ? 'mark' : 'span', + { + key: i - 1, + className: highlighted ? highlightClassName : undefined, + }, + text.substring(start, end) + ) ); highlighted = !highlighted; } diff --git a/public/app/core/components/TransformersUI/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx b/public/app/core/components/TransformersUI/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx index e623c9fb215..5738f38b09e 100644 --- a/public/app/core/components/TransformersUI/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx +++ b/public/app/core/components/TransformersUI/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx @@ -9,7 +9,7 @@ type PropNames = 'from' | 'to'; export function rangeMatcherEditor( config: ValueMatcherEditorConfig ): React.FC>> { - return ({ options, onChange, field }) => { + return function RangeMatcherEditor({ options, onChange, field }) { const { validator } = config; const [isInvalid, setInvalid] = useState({ from: !validator(options.from), diff --git a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx index f046dba8013..24095f3320d 100644 --- a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx +++ b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.tsx @@ -155,6 +155,8 @@ export const DashboardPrompt = React.memo(({ dashboard }: Props) => { ); }); +DashboardPrompt.displayName = 'DashboardPrompt'; + function moveToBlockedLocationAfterReactStateUpdate(location?: H.Location | null) { if (location) { setTimeout(() => locationService.push(location!), 10); diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx index 387ac9e0961..c94902dd4c5 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx @@ -112,6 +112,8 @@ export const OptionsPaneCategory: FC = React.memo( } ); +OptionsPaneCategory.displayName = 'OptionsPaneCategory'; + const getStyles = (theme: GrafanaTheme2) => { return { box: css` diff --git a/public/app/features/explore/TraceView/createSpanLink.tsx b/public/app/features/explore/TraceView/createSpanLink.tsx index 1b74869f1f1..3133272d1d3 100644 --- a/public/app/features/explore/TraceView/createSpanLink.tsx +++ b/public/app/features/explore/TraceView/createSpanLink.tsx @@ -36,7 +36,7 @@ export function createSpanLinkFactory({ // let's try to use the old legacy path. return legacyCreateSpanLinkFactory(splitOpenFn, traceToLogsOptions); } else { - return function (span: TraceSpan): SpanLinkDef | undefined { + return function SpanLink(span: TraceSpan): SpanLinkDef | undefined { // We should be here only if there are some links in the dataframe const field = dataFrame.fields.find((f) => Boolean(f.config.links?.length))!; try { @@ -74,7 +74,7 @@ function legacyCreateSpanLinkFactory(splitOpenFn: SplitOpen, traceToLogsOptions? return undefined; } - return function (span: TraceSpan): SpanLinkDef { + return function SpanLink(span: TraceSpan): SpanLinkDef { // This is reusing existing code from derived fields which may not be ideal match so some data is a bit faked at // the moment. Issue is that the trace itself isn't clearly mapped to dataFrame (right now it's just a json blob // inside a single field) so the dataLinks as config of that dataFrame abstraction breaks down a bit and we do diff --git a/public/app/features/search/components/ManageDashboards.tsx b/public/app/features/search/components/ManageDashboards.tsx index bd1d407b966..3379e0b5869 100644 --- a/public/app/features/search/components/ManageDashboards.tsx +++ b/public/app/features/search/components/ManageDashboards.tsx @@ -141,6 +141,8 @@ export const ManageDashboards: FC = memo(({ folder }) => { ); }); +ManageDashboards.displayName = 'ManageDashboards'; + export default ManageDashboards; const getStyles = stylesFactory((theme: GrafanaTheme) => { diff --git a/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx b/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx index 35dbc0a8ac1..37dce028125 100644 --- a/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx @@ -121,6 +121,8 @@ export const PromExploreExtraField: React.FC = memo( } ); +PromExploreExtraField.displayName = 'PromExploreExtraField'; + export const testIds = { extraFieldEditor: 'prom-editor-extra-field', stepField: 'prom-editor-extra-field-step', diff --git a/yarn.lock b/yarn.lock index 1f3293d7632..c3616f9aac7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11902,7 +11902,7 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.0.3, array-includes@npm:^3.1.1, array-includes@npm:^3.1.3": +"array-includes@npm:^3.0.3, array-includes@npm:^3.1.1, array-includes@npm:^3.1.3, array-includes@npm:^3.1.4": version: 3.1.4 resolution: "array-includes@npm:3.1.4" dependencies: @@ -11976,7 +11976,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.flatmap@npm:^1.2.1, array.prototype.flatmap@npm:^1.2.3": +"array.prototype.flatmap@npm:^1.2.1, array.prototype.flatmap@npm:^1.2.3, array.prototype.flatmap@npm:^1.2.5": version: 1.2.5 resolution: "array.prototype.flatmap@npm:1.2.5" dependencies: @@ -17350,6 +17350,30 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-react@npm:7.27.1": + version: 7.27.1 + resolution: "eslint-plugin-react@npm:7.27.1" + dependencies: + array-includes: ^3.1.4 + array.prototype.flatmap: ^1.2.5 + doctrine: ^2.1.0 + estraverse: ^5.3.0 + jsx-ast-utils: ^2.4.1 || ^3.0.0 + minimatch: ^3.0.4 + object.entries: ^1.1.5 + object.fromentries: ^2.0.5 + object.hasown: ^1.1.0 + object.values: ^1.1.5 + prop-types: ^15.7.2 + resolve: ^2.0.0-next.3 + semver: ^6.3.0 + string.prototype.matchall: ^4.0.6 + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + checksum: db1ce303b597ede0bc8873d3f575b05873b06a058162c80f76604c9096eee8f72f299d7f849a86ac2e59f269c196575e6bcfb1ef9d7cbb23f533d081bcc15ea0 + languageName: node + linkType: hard + "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" @@ -17604,7 +17628,7 @@ __metadata: languageName: node linkType: hard -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": +"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0, estraverse@npm:^5.3.0": version: 5.3.0 resolution: "estraverse@npm:5.3.0" checksum: 072780882dc8416ad144f8fe199628d2b3e7bbc9989d9ed43795d2c90309a2047e6bc5979d7e2322a341163d22cfad9e21f4110597fe487519697389497e4e2b @@ -19541,7 +19565,7 @@ __metadata: eslint-plugin-lodash: ^7.2.0 eslint-plugin-no-only-tests: 2.6.0 eslint-plugin-prettier: 4.0.0 - eslint-plugin-react: 7.22.0 + eslint-plugin-react: 7.27.1 eslint-plugin-react-hooks: 4.2.0 eslint-webpack-plugin: 3.1.0 eventemitter3: 4.0.0 @@ -26011,7 +26035,7 @@ __metadata: languageName: node linkType: hard -"object.entries@npm:^1.1.0, object.entries@npm:^1.1.1, object.entries@npm:^1.1.2": +"object.entries@npm:^1.1.0, object.entries@npm:^1.1.1, object.entries@npm:^1.1.2, object.entries@npm:^1.1.5": version: 1.1.5 resolution: "object.entries@npm:1.1.5" dependencies: @@ -26022,7 +26046,7 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.0, object.fromentries@npm:^2.0.0 || ^1.0.0, object.fromentries@npm:^2.0.2": +"object.fromentries@npm:^2.0.0, object.fromentries@npm:^2.0.0 || ^1.0.0, object.fromentries@npm:^2.0.2, object.fromentries@npm:^2.0.5": version: 2.0.5 resolution: "object.fromentries@npm:2.0.5" dependencies: @@ -26044,6 +26068,16 @@ __metadata: languageName: node linkType: hard +"object.hasown@npm:^1.1.0": + version: 1.1.0 + resolution: "object.hasown@npm:1.1.0" + dependencies: + define-properties: ^1.1.3 + es-abstract: ^1.19.1 + checksum: 5c5d0b1b793514609f7a635f3110fbd346e142c9afd2485b802775e1ef6c90e48ff6e8e8744927933370ba30964e21af9c5fcf782b47f34d650aa6b277565330 + languageName: node + linkType: hard + "object.pick@npm:^1.3.0": version: 1.3.0 resolution: "object.pick@npm:1.3.0" @@ -26053,7 +26087,7 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.0, object.values@npm:^1.1.1": +"object.values@npm:^1.1.0, object.values@npm:^1.1.1, object.values@npm:^1.1.5": version: 1.1.5 resolution: "object.values@npm:1.1.5" dependencies: @@ -30802,6 +30836,16 @@ __metadata: languageName: node linkType: hard +"resolve@npm:^2.0.0-next.3": + version: 2.0.0-next.3 + resolution: "resolve@npm:2.0.0-next.3" + dependencies: + is-core-module: ^2.2.0 + path-parse: ^1.0.6 + checksum: f34b3b93ada77d64a6d590c06a83e198f3a827624c4ec972260905fa6c4d612164fbf0200d16d2beefea4ad1755b001f4a9a1293d8fc2322a8f7d6bf692c4ff5 + languageName: node + linkType: hard + "resolve@npm:~1.17.0": version: 1.17.0 resolution: "resolve@npm:1.17.0" @@ -30831,6 +30875,16 @@ __metadata: languageName: node linkType: hard +"resolve@patch:resolve@^2.0.0-next.3#~builtin": + version: 2.0.0-next.3 + resolution: "resolve@patch:resolve@npm%3A2.0.0-next.3#~builtin::version=2.0.0-next.3&hash=07638b" + dependencies: + is-core-module: ^2.2.0 + path-parse: ^1.0.6 + checksum: 21684b4d99a4877337cdbd5484311c811b3e8910edb5d868eec85c6e6550b0f570d911f9a384f9e176172d6713f2715bd0b0887fa512cb8c6aeece018de6a9f8 + languageName: node + linkType: hard + "resolve@patch:resolve@~1.17.0#~builtin": version: 1.17.0 resolution: "resolve@patch:resolve@npm%3A1.17.0#~builtin::version=1.17.0&hash=07638b" @@ -32557,7 +32611,7 @@ __metadata: languageName: node linkType: hard -"string.prototype.matchall@npm:^4.0.0 || ^3.0.1, string.prototype.matchall@npm:^4.0.2": +"string.prototype.matchall@npm:^4.0.0 || ^3.0.1, string.prototype.matchall@npm:^4.0.2, string.prototype.matchall@npm:^4.0.6": version: 4.0.6 resolution: "string.prototype.matchall@npm:4.0.6" dependencies: