Skip to content

Commit dadfe54

Browse files
heiskrCopilot
andauthored
Remove no-explicit-any violations from content-render entrypoints (#61666)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3b48c51 commit dadfe54

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

eslint.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,9 @@ export default [
238238
'src/article-api/transformers/rest-transformer.ts',
239239
'src/codeql-cli/scripts/convert-markdown-for-docs.ts',
240240
'src/content-linter/scripts/lint-content.ts',
241-
'src/content-render/liquid/index.ts',
242241
'src/content-render/scripts/liquid-tags.ts',
243242
'src/content-render/scripts/move-content.ts',
244243
'src/content-render/unified/annotate.ts',
245-
'src/content-render/unified/index.ts',
246244
'src/data-directory/lib/get-data.ts',
247245
'src/frame/components/context/MainContext.tsx',
248246
'src/frame/lib/page-data.ts',

src/content-render/liquid/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { processLiquidPost } from './post'
22
import { engine } from './engine'
3+
import type { Context } from '@/types'
34

4-
export async function renderLiquid(template: string, context: any): Promise<string> {
5+
export async function renderLiquid(template: string, context: Context): Promise<string> {
56
if (template.includes('{%') || template.includes('{{')) {
67
template = await engine.parseAndRender(template, context)
78
}

src/content-render/unified/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { fastTextOnly } from '@/content-render/unified/text-only'
22
import { createProcessor, createMarkdownOnlyProcessor } from '@/content-render/unified/processor'
3+
import type { Context } from '@/types'
34

45
interface RenderOptions {
56
textOnly?: boolean
67
}
78

8-
export async function renderUnified(template: string, context: any, options: RenderOptions = {}) {
9+
export async function renderUnified(
10+
template: string,
11+
context: Context,
12+
options: RenderOptions = {},
13+
) {
914
const processor = createProcessor(context)
1015
const vFile = await processor.process(template)
1116
let html = vFile.toString()
@@ -17,7 +22,7 @@ export async function renderUnified(template: string, context: any, options: Ren
1722
return html.trim()
1823
}
1924

20-
export async function renderMarkdown(template: string, context: any) {
25+
export async function renderMarkdown(template: string, context: Context) {
2126
const processor = createMarkdownOnlyProcessor(context)
2227
const vFile = await processor.process(template)
2328
const markdown = vFile.toString()

src/links/lib/extract-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export function createLiquidContext(
303303

304304
// Cached reference to renderLiquid — avoids repeated dynamic-import overhead on every call.
305305
// A dynamic import is still used (not a top-level import) to prevent circular dependency issues.
306-
type RenderLiquidModule = (template: string, context: unknown) => Promise<string>
306+
type RenderLiquidModule = (template: string, context: Context) => Promise<string>
307307
let _renderLiquid: RenderLiquidModule | null = null
308308
async function getCachedRenderLiquid(): Promise<RenderLiquidModule> {
309309
if (!_renderLiquid) {

src/links/scripts/check-links-internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async function getLinksFromMarkdown(
135135
const needsLiquidHrefResolution =
136136
rawResult.internalLinks.some((l) => l.href.includes('{%') || l.href.includes('{{')) ||
137137
rawResult.liquidPrefixedLinks.length > 0
138-
type RenderLiquidFn = (template: string, context: unknown) => Promise<string>
138+
type RenderLiquidFn = (template: string, context: Context) => Promise<string>
139139
let renderLiquidFn: RenderLiquidFn | null = null
140140
if (needsLiquidHrefResolution) {
141141
const mod = await import('@/content-render/liquid/index')

0 commit comments

Comments
 (0)