removed eslint-ignore statements

This commit is contained in:
devcer
2022-10-17 09:33:01 +05:30
7 changed files with 36 additions and 43 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @cspell/spellchecker */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { defineConfig } = require('cypress');

View File

@@ -53,7 +53,12 @@
"bbox",
"techn",
"cytoscape",
"ts-nocheck"
"Lucida",
"Bilkent",
"cpettitt",
"antiscript",
"ts-nocheck",
"setupGraphViewbox"
],
"patterns": [
{

View File

@@ -21,7 +21,7 @@ describe('Git Graph diagram', () => {
// // Call Open on eyes to initialize a test session
// cy.eyesOpen({
// appName: 'Demo App',
// testName: 'Ultrafast grid demo',
// testName: 'UltraFast grid demo',
// });
// // check the login page with fluent api, see more info here

View File

@@ -119,13 +119,11 @@ const config: Partial<MermaidConfig> = {
/**
* This option controls if the generated ids of nodes in the SVG are generated randomly or based
* on a seed. If set to false, the IDs are generated based on the current date and thus are not
// eslint-disable-next-line @cspell/spellchecker
* deterministic. This is the default behaviour.
* deterministic. This is the default behavior.
*
* **Notes**:
*
// eslint-disable-next-line @cspell/spellchecker
* This matters if your files are checked into sourcecontrol e.g. git and should not change unless
* This matters if your files are checked into source control e.g. git and should not change unless
* content is changed.
*
* Default value: false
@@ -635,9 +633,9 @@ const config: Partial<MermaidConfig> = {
numberSectionStyles: 4,
/**
* | Parameter | Description | Type | Required | Values |
* | ---------- | --------------------------- | ---- | -------- | ---------------- |
* | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd |
* | Parameter | Description | Type | Required | Values |
* | ---------- | ---------------------------- | ---- | -------- | ---------------- |
* | axisFormat | Date/time format of the axis | 3 | Required | Date in yy-mm-dd |
*
* **Notes:**
*

View File

@@ -65,17 +65,6 @@ describe('when parsing a gantt diagram it', function () {
expect(parserFnConstructor(str)).not.toThrow();
});
/**
* Beslutsflöde inligt nedan. Obs bla bla bla
*
* graph TD
* A[Hard pledge] -- text on link -->B(Round edge)
* B --> C{to do or not to do}
* C -->|Too| D[Result one]
* C -->|Doo| E[Result two]
*
* Params bapa - a unique bapap
*/
it('should handle a task definition', function () {
const str =
'gantt\n' +

View File

@@ -130,7 +130,7 @@ Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!`;
mermaidAPI.parse(str);
diagram.renderer.draw(str, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility autonumbers
diagram.renderer.draw(str, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility auto numbers
expect(diagram.db.showSequenceNumbers()).toBe(false);
});
it('should show sequence numbers when autonumber is enabled', function () {
@@ -142,7 +142,7 @@ Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!`;
mermaidAPI.parse(str);
diagram.renderer.draw(str, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility autonumbers
diagram.renderer.draw(str, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility auto numbers
expect(diagram.db.showSequenceNumbers()).toBe(true);
});
it('should handle a sequenceDiagram definition with a title:', function () {
@@ -1871,7 +1871,7 @@ Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!`;
mermaidAPI.parse(str1, diagram);
diagram.renderer.draw(str1, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility autonumbers
diagram.renderer.draw(str1, 'tst', '1.2.3', diagram); // needs to be rendered for the correct value of visibility auto numbers
expect(diagram.db.showSequenceNumbers()).toBe(true);
const str2 = `

View File

@@ -292,15 +292,15 @@ const boundMessage = function (diagram, msgModel) {
bounds.bumpVerticalPos(lineHeight);
let lineStarty;
let lineStartY;
let totalOffset = textDims.height - 10;
const textWidth = textDims.width;
if (startx === stopx) {
lineStarty = bounds.getVerticalPos() + totalOffset;
lineStartY = bounds.getVerticalPos() + totalOffset;
if (!conf.rightAngles) {
totalOffset += conf.boxMargin;
lineStarty = bounds.getVerticalPos() + totalOffset;
lineStartY = bounds.getVerticalPos() + totalOffset;
}
totalOffset += 30;
const dx = Math.max(textWidth / 2, conf.width / 2);
@@ -312,15 +312,15 @@ const boundMessage = function (diagram, msgModel) {
);
} else {
totalOffset += conf.boxMargin;
lineStarty = bounds.getVerticalPos() + totalOffset;
bounds.insert(startx, lineStarty - 10, stopx, lineStarty);
lineStartY = bounds.getVerticalPos() + totalOffset;
bounds.insert(startx, lineStartY - 10, stopx, lineStartY);
}
bounds.bumpVerticalPos(totalOffset);
msgModel.height += totalOffset;
msgModel.stopy = msgModel.starty + msgModel.height;
bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy);
return lineStarty;
return lineStartY;
};
/**
@@ -328,10 +328,10 @@ const boundMessage = function (diagram, msgModel) {
*
* @param {any} diagram - The parent of the message element
* @param {any} msgModel - The model containing fields describing a message
* @param {number} lineStarty - The Y coordinate at which the message line starts
* @param {number} lineStartY - The Y coordinate at which the message line starts
* @param diagObj
*/
const drawMessage = function (diagram, msgModel, lineStarty, diagObj) {
const drawMessage = function (diagram, msgModel, lineStartY, diagObj) {
const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel;
const textDims = utils.calculateTextDimensions(message, messageFont(conf));
const textObj = svgDraw.getTextObj();
@@ -360,8 +360,8 @@ const drawMessage = function (diagram, msgModel, lineStarty, diagObj) {
.append('path')
.attr(
'd',
`M ${startx},${lineStarty} H ${startx + Math.max(conf.width / 2, textWidth / 2)} V ${
lineStarty + 25
`M ${startx},${lineStartY} H ${startx + Math.max(conf.width / 2, textWidth / 2)} V ${
lineStartY + 25
} H ${startx}`
);
} else {
@@ -372,27 +372,27 @@ const drawMessage = function (diagram, msgModel, lineStarty, diagObj) {
'M ' +
startx +
',' +
lineStarty +
lineStartY +
' C ' +
(startx + 60) +
',' +
(lineStarty - 10) +
(lineStartY - 10) +
' ' +
(startx + 60) +
',' +
(lineStarty + 30) +
(lineStartY + 30) +
' ' +
startx +
',' +
(lineStarty + 20)
(lineStartY + 20)
);
}
} else {
line = diagram.append('line');
line.attr('x1', startx);
line.attr('y1', lineStarty);
line.attr('y1', lineStartY);
line.attr('x2', stopx);
line.attr('y2', lineStarty);
line.attr('y2', lineStartY);
}
// Make an SVG Container
// Draw the line
@@ -440,7 +440,7 @@ const drawMessage = function (diagram, msgModel, lineStarty, diagObj) {
diagram
.append('text')
.attr('x', startx)
.attr('y', lineStarty + 4)
.attr('y', lineStartY + 4)
.attr('font-family', 'sans-serif')
.attr('font-size', '12px')
.attr('text-anchor', 'middle')
@@ -811,8 +811,8 @@ export const draw = function (_text, id, _version, diagObj) {
msgModel.starty = bounds.getVerticalPos();
msgModel.sequenceIndex = sequenceIndex;
msgModel.sequenceVisible = diagObj.db.showSequenceNumbers();
const lineStarty = boundMessage(diagram, msgModel);
messagesToDraw.push({ messageModel: msgModel, lineStarty: lineStarty });
const lineStartY = boundMessage(diagram, msgModel);
messagesToDraw.push({ messageModel: msgModel, lineStartY: lineStartY });
bounds.models.addMessage(msgModel);
} catch (e) {
log.error('error while drawing message', e);
@@ -836,7 +836,7 @@ export const draw = function (_text, id, _version, diagObj) {
}
});
messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStarty, diagObj));
messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStartY, diagObj));
if (conf.mirrorActors) {
// Draw actors below diagram