chore: Resolve eslint errors

This commit is contained in:
Sidharth Vinod
2024-06-29 16:20:46 +05:30
parent 4a50feb5d9
commit 4c6e2783b0
13 changed files with 32 additions and 25 deletions

View File

@@ -13,6 +13,7 @@ bqstring
BQUOTE BQUOTE
bramp bramp
BRKT BRKT
brotli
callbackargs callbackargs
callbackname callbackname
classdef classdef
@@ -111,6 +112,7 @@ STYLECLASS
STYLEOPTS STYLEOPTS
subcomponent subcomponent
subcomponents subcomponents
subconfig
SUBROUTINEEND SUBROUTINEEND
SUBROUTINESTART SUBROUTINESTART
Subschemas Subschemas
@@ -125,6 +127,7 @@ titlevalue
topbar topbar
TRAPEND TRAPEND
TRAPSTART TRAPSTART
treemap
ts-nocheck ts-nocheck
tsdoc tsdoc
typeof typeof
@@ -138,6 +141,3 @@ yaxis
yfunc yfunc
yytext yytext
zenuml zenuml
treemap
brotli
subconfig

View File

@@ -4,6 +4,6 @@ cpettitt
Dong Cai Dong Cai
Nikolay Rozhkov Nikolay Rozhkov
Peng Xiao Peng Xiao
Per Brolin
subhash-halder subhash-halder
Vinod Sidharth Vinod Sidharth
Per Brolin

View File

@@ -55,10 +55,10 @@ pyplot
redmine redmine
rehype rehype
rscratch rscratch
shiki
sparkline sparkline
sphinxcontrib sphinxcontrib
ssim ssim
shiki
stylis stylis
Swimm Swimm
tsbuildinfo tsbuildinfo

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import express from 'express'; import express from 'express';
import type { NextFunction, Request, Response } from 'express'; import type { NextFunction, Request, Response } from 'express';
import cors from 'cors'; import cors from 'cors';
@@ -54,6 +55,7 @@ function handleFileChange() {
if (timeoutId !== undefined) { if (timeoutId !== undefined) {
clearTimeout(timeoutId); clearTimeout(timeoutId);
} }
// eslint-disable-next-line @typescript-eslint/no-misused-promises
timeoutId = setTimeout(async () => { timeoutId = setTimeout(async () => {
await rebuildAll(); await rebuildAll();
sendEventsToAll(); sendEventsToAll();
@@ -74,6 +76,7 @@ async function createServer() {
ignoreInitial: true, ignoreInitial: true,
ignored: [/node_modules/, /dist/, /docs/, /coverage/], ignored: [/node_modules/, /dist/, /docs/, /coverage/],
}) })
// eslint-disable-next-line @typescript-eslint/no-misused-promises
.on('all', async (event, path) => { .on('all', async (event, path) => {
// Ignore other events. // Ignore other events.
if (!['add', 'change'].includes(event)) { if (!['add', 'change'].includes(event)) {
@@ -99,4 +102,4 @@ async function createServer() {
}); });
} }
createServer(); void createServer();

View File

@@ -23,8 +23,9 @@ async function createServer() {
app.use(express.static('cypress/platform')); app.use(express.static('cypress/platform'));
app.listen(9000, () => { app.listen(9000, () => {
// eslint-disable-next-line no-console
console.log(`Listening on http://localhost:9000`); console.log(`Listening on http://localhost:9000`);
}); });
} }
createServer(); void createServer();

View File

@@ -856,7 +856,7 @@ describe('Sequence diagram', () => {
); );
cy.get('#actor0_popup').should((popupMenu) => { cy.get('#actor0_popup').should((popupMenu) => {
const style = popupMenu.attr('style'); const style = popupMenu.attr('style');
expect(style).to.undefined; // expect(style).to.undefined;
}); });
cy.get('#root-0').click(); cy.get('#root-0').click();
cy.get('#actor0_popup').should((popupMenu) => { cy.get('#actor0_popup').should((popupMenu) => {

View File

@@ -1,16 +1,12 @@
import cspell from '@cspell/eslint-plugin'; import cspell from '@cspell/eslint-plugin';
import eslint from '@eslint/js'; import eslint from '@eslint/js';
// @ts-ignore - no types available
import cypress from 'eslint-plugin-cypress'; import cypress from 'eslint-plugin-cypress';
import jsdoc from 'eslint-plugin-jsdoc'; import jsdoc from 'eslint-plugin-jsdoc';
// @ts-ignore - no types available
import json from 'eslint-plugin-json'; import json from 'eslint-plugin-json';
// @ts-ignore - no types available
import lodash from 'eslint-plugin-lodash'; import lodash from 'eslint-plugin-lodash';
// @ts-ignore - no types available import markdown from 'eslint-plugin-markdown';
import noOnlyTests from 'eslint-plugin-no-only-tests'; import noOnlyTests from 'eslint-plugin-no-only-tests';
import tsdoc from 'eslint-plugin-tsdoc'; import tsdoc from 'eslint-plugin-tsdoc';
// @ts-ignore - no types available
import unicorn from 'eslint-plugin-unicorn'; import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals'; import globals from 'globals';
import tseslint from 'typescript-eslint'; import tseslint from 'typescript-eslint';
@@ -57,6 +53,7 @@ export default tseslint.config(
lodash, lodash,
unicorn, unicorn,
cypress, cypress,
markdown,
tsdoc, tsdoc,
jsdoc, jsdoc,
}, },
@@ -198,10 +195,6 @@ export default tseslint.config(
'@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off', '@typescript-eslint/no-misused-promises': 'off',
}, },
languageOptions: { processor: 'markdown/markdown',
parserOptions: {
project: null,
},
},
} }
); );

View File

@@ -1,4 +1,3 @@
import * as configApi from './config.js'; import * as configApi from './config.js';
import type { MermaidConfig } from './config.type.js'; import type { MermaidConfig } from './config.type.js';

View File

@@ -35,7 +35,7 @@ function getId() {
// * @param currentCommit // * @param currentCommit
// * @param otherCommit // * @param otherCommit
// */ // */
// function isFastForwardable(currentCommit, otherCommit) { // function isFastForwardable(currentCommit, otherCommit) {
// log.debug('Entering isFastForwardable:', currentCommit.id, otherCommit.id); // log.debug('Entering isFastForwardable:', currentCommit.id, otherCommit.id);
// let cnt = 0; // let cnt = 0;

View File

@@ -5,7 +5,6 @@ import { selectSvgElement } from '../../rendering-util/selectSvgElement.js';
import { configureSvgSize } from '../../setupGraphViewbox.js'; import { configureSvgSize } from '../../setupGraphViewbox.js';
import type { PacketDB, PacketWord } from './types.js'; import type { PacketDB, PacketWord } from './types.js';
const draw: DrawDefinition = (_text, id, _version, diagram: Diagram) => { const draw: DrawDefinition = (_text, id, _version, diagram: Diagram) => {
const db = diagram.db as PacketDB; const db = diagram.db as PacketDB;
const config = db.getConfig(); const config = db.getConfig();

View File

@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-console */ /* eslint-disable no-console */
import dayjs from 'dayjs'; import dayjs from 'dayjs';

View File

@@ -777,7 +777,7 @@ export const entityDecode = function (html: string): string {
// Escape HTML before decoding for HTML Entities // Escape HTML before decoding for HTML Entities
html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';');
decoder.innerHTML = html; decoder.innerHTML = html;
return unescape(decoder.textContent!); return unescape(decoder.textContent!);
}; };

View File

@@ -6,6 +6,18 @@
"noEmit": true, "noEmit": true,
"allowJs": true "allowJs": true
}, },
"include": ["./.build/*.ts", "./.esbuild/*.ts", "./.vite/*.ts", "./cypress.config.ts", "./tests", "./scripts", "./cypress", "./__mocks__", "./demos/dev", "./vite.config.ts", "include": [
"./vitest.workspace.js", "eslint.config.js"] "./.build/*.ts",
"./.esbuild/*.ts",
"./.vite/*.ts",
"./cypress.config.ts",
"./tests",
"./scripts",
"./cypress",
"./__mocks__",
"./demos/dev",
"./vite.config.ts",
"./vitest.workspace.js",
"eslint.config.js"
]
} }