mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-18 13:47:45 +01:00
Fix lint errors
This commit is contained in:
1
plugins-external/faker/src/faker-js__faker.d.ts
vendored
Normal file
1
plugins-external/faker/src/faker-js__faker.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare module '@faker-js/faker';
|
||||
@@ -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 Yaak’s 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) => ({
|
||||
|
||||
Reference in New Issue
Block a user