diff --git a/samples/react-page-navigator/src/Service/NavLinkBuilder.ts b/samples/react-page-navigator/src/Service/NavLinkBuilder.ts index b4ec509f4..a49fbc980 100644 --- a/samples/react-page-navigator/src/Service/NavLinkBuilder.ts +++ b/samples/react-page-navigator/src/Service/NavLinkBuilder.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + export interface IHierarchyEntry> { links?: IHierarchyEntry[]; } @@ -10,7 +12,7 @@ export class navLinkBuilder { * @param order place order of the new link * @returns navLinks */ - public static build>(currentLinks: T[], newLink: T, order: number) { + public static build>(currentLinks: T[], newLink: T, order: number): void { const lastIndex = currentLinks.length - 1; const startorder:number = (currentLinks as any).__startorder || 0; diff --git a/samples/react-page-navigator/src/Service/SPService.ts b/samples/react-page-navigator/src/Service/SPService.ts index ce1063820..f9cc420ba 100644 --- a/samples/react-page-navigator/src/Service/SPService.ts +++ b/samples/react-page-navigator/src/Service/SPService.ts @@ -15,9 +15,9 @@ export class SPService { private static GetAnchorUrl(headingValue: string): string { let anchorUrl = `#${headingValue .toLowerCase() - .replace(/[{}|\[\]\<\>#@"'^%`?;:\/=~\\\s\s]/g, " ") + .replace(/[{}|[\]<>#@"'^%`?;:/=~\\\s\s]/g, " ") .replace(/^(-|\s)*|(-|\s)*$/g, "") - .replace(/\'|\?|\\|\/| |\&/g, "-") + .replace(/'|\?|\\|\/| |&/g, "-") .replace(/-+/g, "-") .replace(/[+]/g, "%2B") // https://github.com/pnp/sp-dev-fx-webparts/issues/3686 .substring(0, 128)}`; @@ -56,6 +56,7 @@ export class SPService { const data = await context.spHttpClient.get(`${context.pageContext.web.absoluteUrl}/_api/sitepages/pages?$select=CanvasContent1&$filter=Url eq '${currentPageUrl}'`, SPHttpClient.configurations.v1); const jsonData = await data.json(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any let canvasContent1JSON: any[]; try { const canvasContent1 = jsonData.value?.[0].CanvasContent1; diff --git a/samples/react-page-navigator/src/webparts/pageNavigator/components/PageNavigator.tsx b/samples/react-page-navigator/src/webparts/pageNavigator/components/PageNavigator.tsx index a65d78744..ca17cab91 100644 --- a/samples/react-page-navigator/src/webparts/pageNavigator/components/PageNavigator.tsx +++ b/samples/react-page-navigator/src/webparts/pageNavigator/components/PageNavigator.tsx @@ -17,17 +17,17 @@ export default class PageNavigator extends React.Component, item?: INavLink) { + private onLinkClick(ev: React.MouseEvent, item?: INavLink): void { this.setState({ selectedKey: item.key }); }