diff --git a/.betterer.results b/.betterer.results index 3ec7a39139e..b864125c480 100644 --- a/.betterer.results +++ b/.betterer.results @@ -6869,8 +6869,7 @@ exports[`better eslint`] = { ], "public/app/plugins/datasource/loki/components/LokiQueryField.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"] + [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] diff --git a/public/app/plugins/datasource/loki/components/LokiQueryField.tsx b/public/app/plugins/datasource/loki/components/LokiQueryField.tsx index fb172036730..4fb34a0fc83 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryField.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryField.tsx @@ -189,9 +189,7 @@ export class LokiQueryField extends React.PureComponent 0; + const hasLogLabels = datasource.languageProvider.getLabelKeys().length > 0; const chooserText = getChooserText(labelsLoaded, hasLogLabels); const buttonDisabled = !(labelsLoaded && hasLogLabels); @@ -225,7 +223,7 @@ export class LokiQueryField extends React.PureComponent { }; }; -const MonacoQueryField = (props: Props) => { +const MonacoQueryField = ({ languageProvider, history, onBlur, onRunQuery, initialValue }: Props) => { // we need only one instance of `overrideServices` during the lifetime of the react component const overrideServicesRef = useRef(getOverrideServices()); const containerRef = useRef(null); - const { languageProvider, history, onBlur, onRunQuery, initialValue } = props; const langProviderRef = useLatest(languageProvider); const historyRef = useLatest(history); @@ -194,9 +193,5 @@ const MonacoQueryField = (props: Props) => { ); }; -// we will lazy-load this module using React.lazy, -// and that only supports default-exports, -// so we have to default-export this, even if -// it is against the style-guidelines. - +// Default export for lazy load. export default MonacoQueryField;