diff --git a/.eslintrc.js b/.eslintrc.js index d09551ef27422..70c1d8ff53f0c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -407,6 +407,16 @@ module.exports = { }, }, + /** + * Lens overrides + */ + { + files: ['x-pack/plugins/lens/**/*.ts', 'x-pack/plugins/lens/**/*.tsx'], + rules: { + '@typescript-eslint/no-explicit-any': 'error', + }, + }, + /** * disable jsx-a11y for kbn-ui-framework */ diff --git a/x-pack/plugins/lens/index.ts b/x-pack/plugins/lens/index.ts index 5d868d9f63a18..8955bccbde268 100644 --- a/x-pack/plugins/lens/index.ts +++ b/x-pack/plugins/lens/index.ts @@ -7,12 +7,13 @@ import * as Joi from 'joi'; import { Server } from 'hapi'; import { resolve } from 'path'; +import { LegacyPluginInitializer } from 'src/legacy/types'; import { PLUGIN_ID } from './common'; const NOT_INTERNATIONALIZED_PRODUCT_NAME = 'Lens Visualizations'; -export const lens = (kibana: any) => { +export const lens: LegacyPluginInitializer = kibana => { return new kibana.Plugin({ id: PLUGIN_ID, configPrefix: `xpack.${PLUGIN_ID}`, diff --git a/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx b/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx index 9e78c9b48bf2b..7471039a482bf 100644 --- a/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx +++ b/x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx @@ -90,7 +90,7 @@ describe('DragDrop', () => { test('droppable is reflected in the className', () => { const component = render( { + onDrop={(x: unknown) => { throw x; }} droppable diff --git a/x-pack/plugins/lens/public/editor_frame_plugin/editor_frame.tsx b/x-pack/plugins/lens/public/editor_frame_plugin/editor_frame.tsx index 64bc73cd0447a..9ab026db082a2 100644 --- a/x-pack/plugins/lens/public/editor_frame_plugin/editor_frame.tsx +++ b/x-pack/plugins/lens/public/editor_frame_plugin/editor_frame.tsx @@ -19,18 +19,18 @@ interface DatasourceState { datasourceName: string; visualizationName: string; - datasourceState: any; - visualizationState: any; + datasourceState: unknown; + visualizationState: unknown; } interface UpdateDatasourceAction { type: 'UPDATE_DATASOURCE'; - payload: any; + payload: unknown; } interface UpdateVisualizationAction { type: 'UPDATE_VISUALIZATION'; - payload: any; + payload: unknown; } type Action = UpdateDatasourceAction | UpdateVisualizationAction; @@ -86,7 +86,7 @@ export function EditorFrame(props: EditorFrameProps) { render={props.datasources[state.datasourceName].renderDataPanel} nativeProps={{ state: state.datasourceState, - setState: (newState: any) => + setState: (newState: unknown) => dispatch({ type: 'UPDATE_DATASOURCE', payload: newState, @@ -106,7 +106,7 @@ export function EditorFrame(props: EditorFrameProps) { }) ), state: state.visualizationState, - setState: (newState: any) => + setState: (newState: unknown) => dispatch({ type: 'UPDATE_VISUALIZATION', payload: newState,