From 63e3b1af527069c0895560da47331305ccd38f4f Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 23 Mar 2024 15:35:41 +0530 Subject: [PATCH] Linting --- cypress/platform/suppressError.html | 2 +- packages/mermaid/src/mermaidAPI.ts | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/platform/suppressError.html b/cypress/platform/suppressError.html index 347a82c79c..f20f97b598 100644 --- a/cypress/platform/suppressError.html +++ b/cypress/platform/suppressError.html @@ -1,4 +1,4 @@ - + diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index f394ef7f1d..fc5eb77dc8 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -110,7 +110,7 @@ function processAndSetConfigs(text: string) { */ async function parse( text: string, - parseOptions: ParseOptions & { suppressErrors: true }, + parseOptions: ParseOptions & { suppressErrors: true } ): Promise; async function parse(text: string, parseOptions?: ParseOptions): Promise; async function parse(text: string, parseOptions?: ParseOptions): Promise { @@ -138,7 +138,7 @@ async function parse(text: string, parseOptions?: ParseOptions): Promise { return `\n.${cssClass} ${element} { ${cssClasses.join(' !important; ')} !important; }`; }; @@ -152,7 +152,7 @@ export const cssImportantStyles = ( */ export const createCssStyles = ( config: MermaidConfig, - classDefs: Record | null | undefined = {}, + classDefs: Record | null | undefined = {} ): string => { let cssStyles = ''; @@ -201,7 +201,7 @@ export const createUserStyles = ( config: MermaidConfig, graphType: string, classDefs: Record | undefined, - svgId: string, + svgId: string ): string => { const userCSSstyles = createCssStyles(config, classDefs); const allStyles = getStyles(graphType, userCSSstyles, config.themeVariables); @@ -223,7 +223,7 @@ export const createUserStyles = ( export const cleanUpSvgCode = ( svgCode = '', inSandboxMode: boolean, - useArrowMarkerUrls: boolean, + useArrowMarkerUrls: boolean ): string => { let cleanedUpSvg = svgCode; @@ -231,7 +231,7 @@ export const cleanUpSvgCode = ( if (!useArrowMarkerUrls && !inSandboxMode) { cleanedUpSvg = cleanedUpSvg.replace( /marker-end="url\([\d+./:=?A-Za-z-]*?#/g, - 'marker-end="url(#', + 'marker-end="url(#' ); } @@ -279,7 +279,7 @@ export const appendDivSvgG = ( id: string, enclosingDivId: string, divStyle?: string, - svgXlink?: string, + svgXlink?: string ): D3Element => { const enclosingDiv = parentRoot.append('div'); enclosingDiv.attr('id', enclosingDivId); @@ -328,7 +328,7 @@ export const removeExistingElements = ( doc: Document, id: string, divId: string, - iFrameId: string, + iFrameId: string ) => { // Remove existing SVG element if it exists doc.getElementById(id)?.remove(); @@ -347,7 +347,7 @@ export const removeExistingElements = ( const render = async function ( id: string, text: string, - svgContainingElement?: Element, + svgContainingElement?: Element ): Promise { addDiagrams(); @@ -532,7 +532,7 @@ function initialize(options: MermaidConfig = {}) { if (options?.theme && options.theme in theme) { // Todo merge with user options options.themeVariables = theme[options.theme as keyof typeof theme].getThemeVariables( - options.themeVariables, + options.themeVariables ); } else if (options) { options.themeVariables = theme.default.getThemeVariables(options.themeVariables); @@ -562,7 +562,7 @@ function addA11yInfo( diagramType: string, svgNode: D3Element, a11yTitle?: string, - a11yDescr?: string, + a11yDescr?: string ): void { setA11yDiagramInfo(svgNode, diagramType); addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr('id'));