Skip to content

Commit

Permalink
remove ts-ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Jul 26, 2022
1 parent bc5f085 commit 0d12d60
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions npm/vite-dev-server/src/plugins/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0d12d60

Please sign in to comment.