Replace 'any' types with 'unknown' or specific types (#58694)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user