Update dependency prettier to v2.5.1 (#43473)

* Update dependency prettier to v2.5.1

* prettier fixes

* chore(toolkit): bump prettier to 2.5.1

* style(eslint): bump grafana config to 2.5.2 in core and toolkit

* style(mssql-datasource): fix no-inferrable-types eslint errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
renovate[bot]
2022-02-02 12:02:32 +00:00
committed by GitHub
parent 3b4e812449
commit d87cd6f26c
304 changed files with 1947 additions and 3209 deletions

View File

@@ -47,24 +47,30 @@ export const DynamicConfigValueEditor: React.FC<DynamicConfigValueEditorProps> =
const labelCategory = item.category?.filter((c) => c !== item.name);
let editor;
// eslint-disable-next-line react/display-name
const renderLabel = (includeDescription = true, includeCounter = false) => (isExpanded = false) => (
<HorizontalGroup justify="space-between">
<Label category={labelCategory} description={includeDescription ? item.description : undefined}>
<Highlighter
textToHighlight={item.name}
searchWords={[searchQuery]}
highlightClassName={'search-fragment-highlight'}
/>
{!isExpanded && includeCounter && item.getItemsCount && <Counter value={item.getItemsCount(property.value)} />}
</Label>
{!isSystemOverride && (
<div>
<IconButton name="times" onClick={onRemove} />
</div>
)}
</HorizontalGroup>
);
/* eslint-disable react/display-name */
const renderLabel =
(includeDescription = true, includeCounter = false) =>
(isExpanded = false) =>
(
<HorizontalGroup justify="space-between">
<Label category={labelCategory} description={includeDescription ? item.description : undefined}>
<Highlighter
textToHighlight={item.name}
searchWords={[searchQuery]}
highlightClassName={'search-fragment-highlight'}
/>
{!isExpanded && includeCounter && item.getItemsCount && (
<Counter value={item.getItemsCount(property.value)} />
)}
</Label>
{!isSystemOverride && (
<div>
<IconButton name="times" onClick={onRemove} />
</div>
)}
</HorizontalGroup>
);
/* eslint-enable react/display-name */
if (isCollapsible) {
editor = (

View File

@@ -25,21 +25,21 @@ describe('standardFieldConfigEditorRegistry', () => {
describe('supportsDataQuery', () => {
describe('when called with plugin that supports queries', () => {
it('then it should return true', () => {
const plugin = ({ meta: { skipDataQuery: false } } as unknown) as PanelPlugin;
const plugin = { meta: { skipDataQuery: false } } as unknown as PanelPlugin;
expect(supportsDataQuery(plugin)).toBe(true);
});
});
describe('when called with plugin that does not support queries', () => {
it('then it should return false', () => {
const plugin = ({ meta: { skipDataQuery: true } } as unknown) as PanelPlugin;
const plugin = { meta: { skipDataQuery: true } } as unknown as PanelPlugin;
expect(supportsDataQuery(plugin)).toBe(false);
});
});
describe('when called without skipDataQuery', () => {
it('then it should return false', () => {
const plugin = ({ meta: {} } as unknown) as PanelPlugin;
const plugin = { meta: {} } as unknown as PanelPlugin;
expect(supportsDataQuery(plugin)).toBe(false);
});
});