From 269722fb6531659c4d821d85a06bae84731b5c9f Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 2 Sep 2022 11:44:06 +0530 Subject: [PATCH 01/24] Introduce stricter linting --- .eslintignore | 2 + .eslintrc.json | 15 +++- cypress/support/eyes-index.d.ts | 2 +- demos/index.html | 4 +- jest.config.js | 1 + package.json | 4 +- src/Diagram.ts | 2 + src/config.ts | 6 +- src/config.type.ts | 2 +- src/diagram-api/diagram-orchestration.ts | 2 +- src/diagram-api/diagramAPI.ts | 22 ++--- .../class/classDiagramGrammar.spec.js | 1 + src/diagrams/git/mockDb.js | 4 +- src/diagrams/info/info.spec.js | 10 ++- src/diagrams/mindmap/info.spc.js | 1 + src/diagrams/sequence/sequenceRenderer.js | 3 +- src/diagrams/sequence/svgDraw.spec.js | 4 +- src/diagrams/state/stateRenderer.js | 4 +- src/diagrams/user-journey/journeyRenderer.js | 1 + src/interactionDb.ts | 4 +- src/jison/transformer.js | 1 + src/logger.ts | 3 + src/mermaid.ts | 11 ++- src/mermaidAPI.ts | 15 ++-- src/styles.ts | 2 +- src/utils.ts | 76 ++++++++--------- yarn.lock | 81 +++++++++++++++++++ 27 files changed, 208 insertions(+), 75 deletions(-) diff --git a/.eslintignore b/.eslintignore index 9d8891de0..60c278861 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,5 @@ dist/** .github/** docs/Setup.md +cypress.config.js +cypress/plugins/index.js diff --git a/.eslintrc.json b/.eslintrc.json index 9c755a0e2..a629acdae 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,7 @@ "jest/globals": true, "node": true }, - "parser": "@babel/eslint-parser", + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { "experimentalObjectRestSpread": true, @@ -15,12 +15,13 @@ }, "extends": [ "eslint:recommended", + "plugin:@typescript-eslint/recommended", "plugin:jsdoc/recommended", "plugin:json/recommended", "plugin:markdown/recommended", "plugin:prettier/recommended" ], - "plugins": ["html", "jest", "jsdoc", "json", "prettier"], + "plugins": ["@typescript-eslint", "html", "jest", "jsdoc", "json", "prettier"], "rules": { "no-prototype-builtins": "off", "no-unused-vars": "off", @@ -31,6 +32,16 @@ "jsdoc/newline-after-description": "off", "jsdoc/tag-lines": "off", "cypress/no-async-tests": "off", + "@typescript-eslint/ban-ts-comment": [ + "error", + { + "ts-expect-error": "allow-with-description", + "ts-ignore": "allow-with-description", + "ts-nocheck": "allow-with-description", + "ts-check": "allow-with-description", + "minimumDescriptionLength": 10 + } + ], "json/*": ["error", "allowComments"], "no-empty": ["error", { "allowEmptyCatch": true }] }, diff --git a/cypress/support/eyes-index.d.ts b/cypress/support/eyes-index.d.ts index b7a17d9de..59fc1eca4 100644 --- a/cypress/support/eyes-index.d.ts +++ b/cypress/support/eyes-index.d.ts @@ -1 +1 @@ -import "@applitools/eyes-cypress" \ No newline at end of file +import '@applitools/eyes-cypress'; diff --git a/demos/index.html b/demos/index.html index 904fde7df..921ffa64e 100644 --- a/demos/index.html +++ b/demos/index.html @@ -1087,7 +1087,9 @@ Enterprise_Boundary(b0, "BankBoundary0") {