chore: Biome fix for-of loops

This commit is contained in:
Sidharth Vinod 2024-06-21 11:55:05 +05:30
parent 08dfdfed82
commit 3381717e86
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
5 changed files with 12 additions and 14 deletions

View File

@ -72,7 +72,7 @@
"noNamespace": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "error",
"useForOf": "warn",
"useForOf": "error",
"useImportType": "error",
"useNamingConvention": {
"level": "off",

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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;
}

View File

@ -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,