From c32095f06a2e2843386120bf21402974b0066954 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Mon, 12 Jul 2021 21:21:50 -0300 Subject: [PATCH] 17782: Removes the last linter warnings. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/common/url.ts | 2 +- src/components/tree/virtual-tree.tsx | 2 ++ .../collection-service/collection-service-files-response.ts | 2 +- src/store/dialog/with-dialog.ts | 1 + src/views/workbench/fed-login.tsx | 2 +- src/views/workbench/workbench-loading-screen.tsx | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/url.ts b/src/common/url.ts index 185737ca..6d66778a 100644 --- a/src/common/url.ts +++ b/src/common/url.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 export function getUrlParameter(search: string, name: string) { - const safeName = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); + const safeName = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]'); const regex = new RegExp('[\\?&]' + safeName + '=([^&#]*)'); const results = regex.exec(search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); diff --git a/src/components/tree/virtual-tree.tsx b/src/components/tree/virtual-tree.tsx index f353fd05..ca7cd40c 100644 --- a/src/components/tree/virtual-tree.tsx +++ b/src/components/tree/virtual-tree.tsx @@ -84,6 +84,7 @@ export interface VirtualTreeItem extends TreeItem { // For some reason, on TSX files it isn't accepted just one generic param, so // I'm using as a workaround. +// eslint-disable-next-line export const Row = (itemList: VirtualTreeItem[], render: any, treeProps: TreeProps) => withStyles(styles)( (props: React.PropsWithChildren & WithStyles) => { const { index, style, classes } = props; @@ -174,6 +175,7 @@ export const Row = (itemList: VirtualTreeItem[], render: any, treeProp const itemSize = 30; +// eslint-disable-next-line export const VirtualList = (height: number, width: number, items: VirtualTreeItem[], render: any, treeProps: TreeProps) => ) }; export const extractFilesData = (document: Document) => { - const collectionUrlPrefix = /\/c=([^\/]*)/; + const collectionUrlPrefix = /\/c=([^/]*)/; return Array .from(document.getElementsByTagName('D:response')) .slice(1) // omit first element which is collection itself diff --git a/src/store/dialog/with-dialog.ts b/src/store/dialog/with-dialog.ts index 78543fc9..ea96ca0d 100644 --- a/src/store/dialog/with-dialog.ts +++ b/src/store/dialog/with-dialog.ts @@ -20,6 +20,7 @@ export type WithDialogDispatchProps = { export type WithDialogProps = WithDialogStateProps & WithDialogDispatchProps; export const withDialog = (id: string) => // TODO: How to make compiler happy with & P instead of & any? + // eslint-disable-next-line (component: React.ComponentType & any>) => connect(mapStateToProps(id), mapDispatchToProps(id))(component); diff --git a/src/views/workbench/fed-login.tsx b/src/views/workbench/fed-login.tsx index 14229519..595f136b 100644 --- a/src/views/workbench/fed-login.tsx +++ b/src/views/workbench/fed-login.tsx @@ -42,7 +42,7 @@ export const FedLogin = connect(mapStateToProps)( } const fedtoken = (remoteHostsConfig[k].loginCluster === localCluster) ? apiToken : getSaltedToken(k, apiToken); - return