1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Replace 'any' types with 'unknown' or specific types (#58694)

This commit is contained in:
Kevin Heis
2025-12-04 11:13:11 -08:00
committed by GitHub
parent cfb053cb67
commit a89743b3c9
26 changed files with 222 additions and 149 deletions

View File

@@ -32,7 +32,8 @@ import fs from 'fs'
import path from 'path'
import chalk from 'chalk'
import { TokenizationError } from 'liquidjs'
import { TokenizationError, TokenKind } from 'liquidjs'
import type { TagToken } from 'liquidjs'
import type { Page } from '@/types'
import warmServer from '@/frame/lib/warm-server'
@@ -246,7 +247,10 @@ function checkString(
// a LOT of different strings in and the cache will fill up rapidly
// when testing every possible string in every possible language for
// every page.
for (const token of getLiquidTokens(string, { noCache: true })) {
const tokens = getLiquidTokens(string, { noCache: true }).filter(
(token): token is TagToken => token.kind === TokenKind.Tag,
)
for (const token of tokens) {
if (token.name === 'ifversion' || token.name === 'elsif') {
for (const arg of token.args.split(/\s+/)) {
if (IGNORE_ARGS.has(arg)) continue