Which packages are affected?
Environment
Node version: v24.14.0
npm version: v11.9.0
@eslint/object-schema: v3.0.3
Operating System:
What did you do?
import { ValidationStrategy } from "@eslint/object-schema";
ValidationStrategy.object([]);
What did you expect to happen?
I expected ValidationStrategy.object([]) to throw a TypeError.
Because ValidationStrategy exposes object() and array() as separate built-in validators, I expected object() not to treat arrays as valid input.
What actually happened?
No error was thrown.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/node-2s958zgk
Participation
AI acknowledgment
Additional comments
If this behavior is intentional, the docs for the built-in object strategy may need to clarify that arrays are considered valid objects.
Which packages are affected?
@eslint/compat@eslint/config-array@eslint/config-helpers@eslint/core@eslint/mcp@eslint/migrate-config@eslint/object-schema@eslint/plugin-kitEnvironment
Node version: v24.14.0
npm version: v11.9.0
@eslint/object-schema: v3.0.3
Operating System:
What did you do?
What did you expect to happen?
I expected
ValidationStrategy.object([])to throw aTypeError.Because
ValidationStrategyexposesobject()andarray()as separate built-in validators, I expectedobject()not to treat arrays as valid input.What actually happened?
No error was thrown.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/node-2s958zgk
Participation
AI acknowledgment
Additional comments
If this behavior is intentional, the docs for the built-in
objectstrategy may need to clarify that arrays are considered valid objects.