Fix lint issues

This commit is contained in:
Ashish Jain
2024-06-13 14:50:52 +02:00
parent ef83adb36e
commit 94512c0780
9 changed files with 10325 additions and 8829 deletions

View File

@@ -25,8 +25,8 @@
"dev:vite": "tsx .vite/server.ts",
"dev:coverage": "pnpm coverage:cypress:clean && VITE_COVERAGE=true pnpm dev:vite",
"release": "pnpm build",
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=8192 eslint --cache --cache-strategy content . && pnpm lint:jison && prettier --cache --check .",
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=8192 eslint --cache --cache-strategy content --fix . && prettier --write . && tsx scripts/fixCSpell.ts",
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=48192 eslint --cache --cache-strategy content . && pnpm lint:jison && prettier --cache --check .",
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=48192 eslint --cache --cache-strategy content --fix . && prettier --write . && tsx scripts/fixCSpell.ts",
"lint:jison": "tsx ./scripts/jison/lint.mts",
"contributors": "tsx scripts/updateContributors.ts",
"cypress": "cypress run",
@@ -127,4 +127,4 @@
"nyc": {
"report-dir": "coverage/cypress"
}
}
}

View File

@@ -725,6 +725,8 @@ export interface StateDiagramConfig extends BaseDiagramConfig {
textHeight?: number;
titleShift?: number;
noteMargin?: number;
nodeSpacing?: number;
rankSpacing?: number;
forkWidth?: number;
forkHeight?: number;
miniPadding?: number;

View File

@@ -26,7 +26,7 @@ const detector: DiagramDetector = (txt, config): boolean => {
}
return false;
};
// @ts-ignore - TODO: Fix after refactor
const loader: DiagramLoader = async () => {
const { diagram } = await import('../flowDiagram-v2.js');
return { id, diagram };

View File

@@ -852,7 +852,7 @@ export const getData = () => {
const n = getVertices();
n.forEach((vertex) => {
addNodeFromVertex(vertex, nodes, parentDB, subGraphDB, config, config.look);
addNodeFromVertex(vertex, nodes, parentDB, subGraphDB, config, config.look || 'classic');
});
const e = getEdges();

View File

@@ -18,6 +18,7 @@ const detector: DiagramDetector = (txt, config) => {
return /^\s*flowchart/.test(txt);
};
// @ts-ignore - TODO: Fix after refactor
const loader: DiagramLoader = async () => {
const { diagram } = await import('./flowDiagram-v2.js');
return { id, diagram };

View File

@@ -69,9 +69,8 @@ export const draw = async function (text: string, id: string, _version: string,
data4Layout.direction = DIR;
// TODO: Should we move these two to baseConfig? These types are not there in StateConfig.
// @ts-expect-error TODO: Will be fixed after config refactor
data4Layout.nodeSpacing = conf?.nodeSpacing || 50;
// @ts-expect-error TODO: Will be fixed after config refactor
data4Layout.rankSpacing = conf?.rankSpacing || 50;
data4Layout.markers = ['barb'];
data4Layout.diagramId = id;

View File

@@ -103,7 +103,6 @@ export const clear = () => {
};
export const positionNode = (node) => {
console.log('Position node', node, node.diff);
const el = nodeElems[node.id];
log.trace(

View File

@@ -52,6 +52,7 @@ required:
- sankey
- packet
- block
- look
properties:
theme:
description: |
@@ -1291,6 +1292,16 @@ $defs: # JSON Schema definition (maybe we should move these to a separate file)
noteMargin:
type: number
default: 10
nodeSpacing:
type: integer
minimum: 0
# should the default value be 50?
# see https://github.com/mermaid-js/mermaid/blob/7647ae317a7b2130e32777248d25a9c4d24b8f9f/packages/mermaid/src/diagrams/class/classRenderer-v2.ts#L258
rankSpacing:
type: integer
minimum: 0
# should the default value be 50?
# see https://github.com/mermaid-js/mermaid/blob/7647ae317a7b2130e32777248d25a9c4d24b8f9f/packages/mermaid/src/diagrams/class/classRenderer-v2.ts#L259
forkWidth:
type: number
default: 70

19126
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff