Fix lint errors

This commit is contained in:
Gregory Schier
2025-12-31 16:17:24 -08:00
parent e435414c2e
commit 07ea1ea7dc
7 changed files with 982 additions and 70 deletions

View File

@@ -0,0 +1 @@
declare module '@faker-js/faker';

View File

@@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker';
import type { PluginDefinition, TemplateFunctionArg } from '@yaakapp/api';
import type { DynamicTemplateFunctionArg, PluginDefinition } from '@yaakapp/api';
const modules = [
'airline',
@@ -33,7 +33,7 @@ function normalizeResult(result: unknown): string {
}
// Whatever Yaaks arg type shape is rough example
function args(modName: string, fnName: string): TemplateFunctionArg[] {
function args(modName: string, fnName: string): DynamicTemplateFunctionArg[] {
return [
{
type: 'banner',
@@ -58,8 +58,7 @@ function args(modName: string, fnName: string): TemplateFunctionArg[] {
export const plugin: PluginDefinition = {
templateFunctions: modules.flatMap((modName) => {
// @ts-expect-error - Dynamic access to faker modules
const mod = faker[modName];
const mod = faker[modName as keyof typeof faker];
return Object.keys(mod)
.filter((n) => n !== 'faker')
.map((fnName) => ({