Introduce stricter linting

This commit is contained in:
Sidharth Vinod
2022-09-02 11:44:06 +05:30
parent 5597cf45bf
commit 269722fb65
27 changed files with 208 additions and 75 deletions

View File

@@ -17,7 +17,7 @@
*/
import { select } from 'd3';
import { compile, serialize, stringify } from 'stylis';
// @ts-ignore
// @ts-ignore: TODO Fix ts errors
import pkg from '../package.json';
import * as configApi from './config';
import { addDiagrams } from './diagram-api/diagram-orchestration';
@@ -38,6 +38,11 @@ import { evaluate } from './diagrams/common/common';
let hasLoadedDiagrams = false;
/**
* @param text
* @param parseError
*/
// eslint-disable-next-line @typescript-eslint/ban-types
function parse(text: string, parseError?: Function): boolean {
if (!hasLoadedDiagrams) {
addDiagrams();
@@ -126,7 +131,7 @@ const render = function (
directiveSanitizer(graphInit);
configApi.addDirective(graphInit);
}
let cnf = configApi.getConfig();
const cnf = configApi.getConfig();
log.debug(cnf);
@@ -319,8 +324,8 @@ const render = function (
svgCode = svgCode.replace(/<br>/g, '<br/>');
if (cnf.securityLevel === 'sandbox') {
let svgEl = root.select('#d' + id + ' svg').node();
let width = '100%';
const svgEl = root.select('#d' + id + ' svg').node();
const width = '100%';
let height = '100%';
if (svgEl) {
height = svgEl.viewBox.baseVal.height + 'px';
@@ -397,7 +402,7 @@ const parseDirective = function (p: any, statement: string, context: string, typ
log.error(
`Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}`
);
// @ts-ignore
// @ts-ignore: TODO Fix ts errors
log.error(error.message);
}
};