mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
chore: Biome fix for-of loops
This commit is contained in:
parent
08dfdfed82
commit
3381717e86
@ -72,7 +72,7 @@
|
||||
"noNamespace": "error",
|
||||
"useAsConstAssertion": "error",
|
||||
"useBlockStatements": "error",
|
||||
"useForOf": "warn",
|
||||
"useForOf": "error",
|
||||
"useImportType": "error",
|
||||
"useNamingConvention": {
|
||||
"level": "off",
|
||||
|
@ -427,9 +427,9 @@ export const draw = async function (text, id, _version, diagObj) {
|
||||
|
||||
selectAll('cluster').append('text');
|
||||
|
||||
for (let j = 0; j < subG.nodes.length; j++) {
|
||||
log.info('Setting up subgraphs', subG.nodes[j], subG.id);
|
||||
g.setParent(subG.nodes[j], subG.id);
|
||||
for (const node of subG.nodes) {
|
||||
log.info('Setting up subgraphs', node, subG.id);
|
||||
g.setParent(node, subG.id);
|
||||
}
|
||||
}
|
||||
await addVertices(vert, g, id, root, doc, diagObj);
|
||||
|
@ -339,14 +339,14 @@ export const draw = async function (text, id, _version, diagObj) {
|
||||
|
||||
selectAll('cluster').append('text');
|
||||
|
||||
for (let j = 0; j < subG.nodes.length; j++) {
|
||||
for (const subGNode of subG.nodes) {
|
||||
log.warn(
|
||||
'Setting subgraph',
|
||||
subG.nodes[j],
|
||||
diagObj.db.lookUpDomId(subG.nodes[j]),
|
||||
subGNode,
|
||||
diagObj.db.lookUpDomId(subGNode),
|
||||
diagObj.db.lookUpDomId(subG.id)
|
||||
);
|
||||
g.setParent(diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id));
|
||||
g.setParent(diagObj.db.lookUpDomId(subGNode), diagObj.db.lookUpDomId(subG.id));
|
||||
}
|
||||
}
|
||||
await addVertices(vert, g, id, root, doc, diagObj);
|
||||
@ -429,8 +429,8 @@ export const draw = async function (text, id, _version, diagObj) {
|
||||
te.attr('transform', `translate(${xPos + _width / 2}, ${yPos + 14})`);
|
||||
te.attr('id', id + 'Text');
|
||||
|
||||
for (let j = 0; j < subG.classes.length; j++) {
|
||||
clusterEl[0].classList.add(subG.classes[j]);
|
||||
for (const subGClass of subG.classes) {
|
||||
clusterEl[0].classList.add(subGClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,8 +362,7 @@ const setupDoc = (g, parentParsedItem, doc, diagramStates, diagramDb, altFlag) =
|
||||
const getDir = (parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
|
||||
let dir = defaultDir;
|
||||
if (parsedItem.doc) {
|
||||
for (let i = 0; i < parsedItem.doc.length; i++) {
|
||||
const parsedItemDoc = parsedItem.doc[i];
|
||||
for (const parsedItemDoc of parsedItem.doc) {
|
||||
if (parsedItemDoc.stmt === 'dir') {
|
||||
dir = parsedItemDoc.value;
|
||||
}
|
||||
|
@ -115,8 +115,7 @@ export const draw = function (text: string, id: string, version: string, diagObj
|
||||
maxEventCount = Math.max(maxEventCount, task.events.length);
|
||||
//calculate maxEventLineLength
|
||||
let maxEventLineLengthTemp = 0;
|
||||
for (let j = 0; j < task.events.length; j++) {
|
||||
const event = task.events[j];
|
||||
for (const event of task.events) {
|
||||
const eventNode = {
|
||||
descr: event,
|
||||
section: task.section,
|
||||
|
Loading…
x
Reference in New Issue
Block a user