Skip to content

docs: remove invalid.fieldName(message) usage #15075

@hyunbinseo

Description

@hyunbinseo

Describe the bug

I don't think these usages are valid after the above PR.

Use invalid.fieldName(message) to create an issue for a specific field. Like fields this is type-safe and you can use regular property access syntax to create issues for deeply nested objects

invalid.profile.email('Email already exists')
invalid.items[0].qty('Insufficient stock')

Since it is imported from @sveltejs/kit, it probably doesn't have type information.

import { invalid } from '@sveltejs/kit';

Reproduction

// Property uuid does not exist on type (...issues: (string | Issue)[]) => never. (ts 2339)
invalid.uuid('');

Logs

System Info

System:
  OS: Windows 11 10.0.26200
  CPU: (8) x64 Intel(R) Core(TM) Ultra 7 258V
  Memory: 3.39 GB / 31.48 GB
Binaries:
  Node: 24.12.0 - C:\Users\hyunb\AppData\Local\fnm_multishells\16180_1766147795233\node.EXE
  Yarn: 1.22.22 - C:\Users\hyunb\AppData\Local\fnm_multishells\16180_1766147795233\yarn.CMD
  npm: 11.6.2 - C:\Users\hyunb\AppData\Local\fnm_multishells\16180_1766147795233\npm.CMD
  pnpm: 10.26.0 - C:\Users\hyunb\AppData\Local\fnm_multishells\16180_1766147795233\pnpm.CMD
  Deno: 2.4.0 - C:\Users\hyunb\.deno\bin\deno.EXE
Browsers:
  Chrome: 143.0.7499.146
  Edge: Chromium (140.0.3485.54)
  Firefox: 146.0 - C:\Program Files\Mozilla Firefox\firefox.exe

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions