style: forbid using `console` in mermaid src code
Adds an eslint rule forbidding using `console` in the mermaid source code. Instead, the `src/logger` should be used instead, so that websites can disable logging. This is allowed in the `cypress/` and `demos/` folder. I've also removed the two instances on `console.log`/`console.error` that currently exist in the mermaid source code.
This commit is contained in:
parent
ec7dd9ef01
commit
cb4935258c
|
@ -22,6 +22,7 @@
|
|||
],
|
||||
"plugins": ["html", "jest", "jsdoc", "json", "prettier"],
|
||||
"rules": {
|
||||
"no-console": "error",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-unused-vars": "off",
|
||||
"jsdoc/check-indentation": "off",
|
||||
|
@ -47,6 +48,12 @@
|
|||
"rules": {
|
||||
"prettier/prettier": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["./cypress/**", "./demos/**"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -535,8 +535,6 @@ describe('when parsing a gitGraph', function () {
|
|||
testBranch3Merge,
|
||||
] = Object.values(commits);
|
||||
|
||||
console.log(Object.keys(commits));
|
||||
|
||||
expect(mainCommit.branch).toBe('main');
|
||||
expect(mainCommit.parents).toStrictEqual([]);
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ export const draw = (text, id, version, diagObj) => {
|
|||
svg.attr('width', 400);
|
||||
// svg.attr('viewBox', '0 0 300 150');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
log.error('Error while rendering info diagram');
|
||||
log.error(e.message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue