Skip to content

Commit

Permalink
more linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed May 21, 2024
1 parent 1202c0c commit a6a36b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/


import {
CoreSetup,
CoreStart,
Expand All @@ -16,7 +15,7 @@ import {
import { DataSourcePluginSetup } from '../../../src/plugins/data_source/server/types';
import { DataSourceManagementPlugin } from '../../../src/plugins/data_source_management/public/plugin';
import sqlPlugin from './clusters/sql/sqlPlugin';
import defineRoutes from './routes';
import { defineRoutes } from './routes';
import { WorkbenchPluginSetup, WorkbenchPluginStart } from './types';

export interface WorkbenchPluginSetupDependencies {
Expand All @@ -31,22 +30,19 @@ export class WorkbenchPlugin implements Plugin<WorkbenchPluginSetup, WorkbenchPl
this.logger = initializerContext.logger.get();
}

public setup(core: CoreSetup, {dataSource} : WorkbenchPluginSetupDependencies) {
public setup(core: CoreSetup, { dataSource }: WorkbenchPluginSetupDependencies) {
this.logger.debug('queryWorkbenchDashboards: Setup');
const router = core.http.createRouter();

const dataSourceEnabled = !!dataSource;

let client: ILegacyClusterClient | undefined = undefined;

Check failure on line 39 in server/plugin.ts

View workflow job for this annotation

GitHub Actions / Lint

It's not necessary to initialize 'client: ILegacyClusterClient | undefined' to undefined

client = core.opensearch.legacy.createClient(
'query_workbench',
{
plugins: [sqlPlugin]
}
)
client = core.opensearch.legacy.createClient('query_workbench', {
plugins: [sqlPlugin],
});
if (dataSourceEnabled) {
dataSource.registerCustomApiSchema(sqlPlugin)
dataSource.registerCustomApiSchema(sqlPlugin);
}

// Register server side APIs
Expand Down
2 changes: 1 addition & 1 deletion server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TranslateService from '../services/TranslateService';
import registerQueryRoute from './query';
import registerTranslateRoute from './translate';

export default function servicesRouter (
export function defineRoutes (
router: IRouter,
client: ILegacyClusterClient | undefined,
openSearchServiceSetup: OpenSearchServiceSetup,
Expand Down

0 comments on commit a6a36b8

Please sign in to comment.