From 0d12d60b24b720fa62e41a5687ce7d62a604e225 Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Wed, 27 Jul 2022 09:26:48 +1000 Subject: [PATCH] remove ts-ignore --- npm/vite-dev-server/src/plugins/cypress.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/npm/vite-dev-server/src/plugins/cypress.ts b/npm/vite-dev-server/src/plugins/cypress.ts index dd7365b66d70..ad45ff88716d 100644 --- a/npm/vite-dev-server/src/plugins/cypress.ts +++ b/npm/vite-dev-server/src/plugins/cypress.ts @@ -2,7 +2,7 @@ import debugFn from 'debug' import { resolve } from 'pathe' import type { ModuleNode, Plugin, ViteDevServer } from 'vite' import type { Vite } from '../getVite' -import { parse } from 'node-html-parser' +import { parse, HTMLElement } from 'node-html-parser' import fs from 'fs' import type { ViteDevServerConfig } from '../devServer' @@ -63,8 +63,7 @@ export const Cypress = ( const root = parse(html) const scriptTagsToInject = root.childNodes.filter((node) => { - // @ts-ignore - return node.rawTagName === 'script' + return node instanceof HTMLElement && node.rawTagName === 'script' }) const indexHtmlPath = resolve(projectRoot, indexHtmlFile)