From 03446ce35c37024d7f1037f2991e713ccf00cfe9 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 22 Jun 2022 01:13:25 +0530 Subject: [PATCH] Re enable markdown & jsdoc linting. --- .eslintrc.json | 4 ++-- docs/development.md | 1 - docs/newDiagram.md | 26 ++++++++++++++------------ package.json | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index dc5adb6f2..9c755a0e2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,9 +15,9 @@ }, "extends": [ "eslint:recommended", - //"plugin:jsdoc/recommended", + "plugin:jsdoc/recommended", "plugin:json/recommended", - // "plugin:markdown/recommended", + "plugin:markdown/recommended", "plugin:prettier/recommended" ], "plugins": ["html", "jest", "jsdoc", "json", "prettier"], diff --git a/docs/development.md b/docs/development.md index 69c87b589..821c893e2 100644 --- a/docs/development.md +++ b/docs/development.md @@ -98,7 +98,6 @@ it('should render forks and joins', () => { ); cy.get('svg'); }); - ``` ### Any Questions or Suggestions? diff --git a/docs/newDiagram.md b/docs/newDiagram.md index b17a0d642..01efdabe3 100644 --- a/docs/newDiagram.md +++ b/docs/newDiagram.md @@ -243,24 +243,26 @@ This function will in turn call a function *your diagram should provide* returni ```js const getStyles = (options) => - ` - .line { - stroke-width: 1; - stroke: ${options.lineColor}; - stroke-dasharray: 2; - } - // ... + ` + .line { + stroke-width: 1; + stroke: ${options.lineColor}; + stroke-dasharray: 2; + } + // ... + `; ``` Note that you need to provide your function to the main getStyles by adding it into the themes object in **src/styles.js** like in the xyzDiagram in the provided example: ```js const themes = { - flowchart, - 'flowchart-v2': flowchart, - sequence, - xyzDiagram - //... + flowchart, + 'flowchart-v2': flowchart, + sequence, + xyzDiagram, + //... +}; ``` The actual options and values for the colors are defined in **src/theme/theme-[xyz].js**. If you provide the options your diagram needs in the existing theme files then the theming will work smoothly without hiccups. diff --git a/package.json b/package.json index 8e03694fa..105298128 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "postbuild": "documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md", "build:watch": "yarn build:development --watch", "release": "yarn build", - "lint": "eslint ./ --ext .js,.json,.html", + "lint": "eslint ./ --ext .js,.json,.html,.md", "lint:fix": "yarn lint --fix", "e2e:depr": "yarn lint && jest e2e --config e2e/jest.config.js", "cypress": "cypress run",