Skip to content
This repository was archived by the owner on Aug 10, 2026. It is now read-only.

Releases: noshiro-pf/ts-data-forge

eslint-plugin-ts-data-forge@0.2.0

Choose a tag to compare

released this 04 Aug 11:14
Immutable release. Only release title and notes can be modified.
492ce41

Minor Changes

  • 534ac4d: Arr.isEmpty and Arr.isNonEmpty now narrow to the branded length-constrained
    array types
    , matching the rest of the Arr length-guard family.

    guard before after
    Arr.isEmpty(xs) readonly [] FixedLengthArray<0, E> & Xs
    Arr.isNonEmpty(xs) NonEmptyArray<E> MinLengthArray<1, E> & Xs

    isEmpty was missing the brand entirely, so it was not equivalent to
    Arr.isFixedLengthArray(xs, 0); isNonEmpty had the brand but dropped the input
    type instead of intersecting with it the way Arr.isMinLengthArray does. Both
    now behave exactly like their is*LengthArray counterparts.

    BREAKING CHANGE: the narrowed types are strictly narrower than before. Code that
    reads the narrowed value keeps compiling, but an explicit annotation such as
    const empty: readonly [] = xs after the guard, or passing the narrowed value
    where an unbranded array literal is expected, may now need the unbranded type
    spelled out.

    prefer-canonical-length-guard follows the new semantics: isFixedLengthArray(xs, 0)
    and isMinLengthArray(xs, 1) are now the type-identical rewrites, and the
    structural *Tuple guards (isFixedLengthTuple(xs, 0), isMaxLengthTuple(xs, 0),
    isBoundedLengthTuple(xs, 0, 0), isMinLengthTuple(xs, 1)) are rewritten too —
    those strengthen the narrowed type by adding the brand.

    prefer-canonical-length-guard additionally absorbs the five xs.length <op> n
    comparison rules — prefer-arr-is-non-empty, prefer-arr-is-min-length-array,
    prefer-arr-is-max-length-array, prefer-arr-is-bounded-length-array and
    prefer-arr-is-fixed-length-array — so one rule now covers both
    comparison → guard and guard → guard normalization.

    BREAKING CHANGE: those five rule names are removed from the plugin; enable
    ts-data-forge/prefer-canonical-length-guard instead. Their behavior is
    unchanged — the rule reuses their implementations rather than reimplementing
    them.

  • 9dd4194: Ship a recommended config preset. eslintPluginTsDataForge.configs.recommended
    is a flat-config object that registers the plugin and enables every rule at
    error, so consuming projects can start from:

    export default [eslintPluginTsDataForge.configs.recommended];

    The preset registers the exported plugin object itself, so listing the plugin in
    your own plugins record alongside the preset does not trigger ESLint's
    Cannot redefine plugin error.

    Also exports the ESLintFlatConfig type alongside the existing ESLintPlugin.

  • 534ac4d: Add the prefer-canonical-length-guard rule, which normalizes degenerate Arr
    length guards to their canonical spelling:

    • Arr.isFixedLengthTuple(xs, 0), Arr.isMaxLengthTuple(xs, 0) and
      Arr.isBoundedLengthTuple(xs, 0, 0)Arr.isEmpty(xs)
    • Arr.isMinLengthArray(xs, 1)Arr.isNonEmpty(xs)

    Every rewrite narrows to exactly the same type, so the autofix is
    type-preserving.

Patch Changes

  • Updated dependencies [534ac4d]
    • ts-data-forge@13.0.0

ts-data-forge@12.2.2

Choose a tag to compare

released this 26 Jul 18:37
Immutable release. Only release title and notes can be modified.
15de7b0

Patch Changes

  • 8ef64f1: chore(deps): bump actions/checkout from 7.0.0 to 7.0.1
  • 37cedcb: chore(deps): bump actions/setup-node from 6.4.0 to 7.0.0
  • 6cb1c29: chore(deps): bump anthropics/claude-code-action from 1.0.177 to 1.0.178

eslint-plugin-ts-data-forge@0.1.7

Choose a tag to compare

released this 26 Jul 18:38
Immutable release. Only release title and notes can be modified.
15de7b0

Patch Changes

  • 8ef64f1: chore(deps): bump actions/checkout from 7.0.0 to 7.0.1
  • 37cedcb: chore(deps): bump actions/setup-node from 6.4.0 to 7.0.0
  • 6cb1c29: chore(deps): bump anthropics/claude-code-action from 1.0.177 to 1.0.178
  • Updated dependencies [8ef64f1]
  • Updated dependencies [37cedcb]
  • Updated dependencies [6cb1c29]
    • ts-data-forge@12.2.2

ts-data-forge@12.2.1

Choose a tag to compare

released this 24 Jul 18:20
Immutable release. Only release title and notes can be modified.
e1943c9

Patch Changes

  • 59bfcbe: Fix how dependencies are specified.

eslint-plugin-ts-data-forge@0.1.6

Choose a tag to compare

released this 24 Jul 18:20
Immutable release. Only release title and notes can be modified.
e1943c9

Patch Changes

  • 59bfcbe: Fix how dependencies are specified.
  • Updated dependencies [59bfcbe]
    • ts-data-forge@12.2.1

ts-data-forge@12.2.0

Choose a tag to compare

released this 23 Jul 20:16
Immutable release. Only release title and notes can be modified.
10984ce

Minor Changes

  • 36b9be2: Make toPushed/toUnshifted return types assignable to NonEmptyArray

eslint-plugin-ts-data-forge@0.1.5

Choose a tag to compare

released this 23 Jul 20:16
Immutable release. Only release title and notes can be modified.
10984ce

Patch Changes

  • Updated dependencies [36b9be2]
    • ts-data-forge@12.2.0

ts-data-forge@12.1.0

Choose a tag to compare

released this 21 Jul 21:50
Immutable release. Only release title and notes can be modified.
1a35cf9

Minor Changes

  • 1bf4200: Add curried overloads and NonEmpty specializations to length validators

ts-data-forge@12.0.0

Choose a tag to compare

released this 21 Jul 07:45
Immutable release. Only release title and notes can be modified.
0ae6291

Major Changes

  • db6c5f5: Rename the branded-number namespaces' clamp operator to fromNumber.

    Every branded number type (Int16, Uint8, PositiveFiniteNumber, …) exposed a
    one-argument clamp(x: number) that coerces an arbitrary number into the type's
    domain by saturating it into [MIN_VALUE, MAX_VALUE] (and rounding to the nearest
    integer, for integer types). This is a total domain projection — the counterpart of
    the is* guard and the throwing as* cast — not the usual three-argument
    clamp(value, lo, hi), and the name collided with Num.clamp (the curried range
    clamp) and the array slice-clamp helpers. It is now named fromNumber, which
    matches what it does and reads correctly even for open-domain types such as
    PositiveFiniteNumber, where there is no natural [lo, hi] range.

    Num.clamp and the array slice-clamped utilities are unchanged.

    The MIN_VALUE / MAX_VALUE constants are unchanged; their JSDoc now clarifies that
    for open-domain types they are the nearest representable in-domain value (the
    saturation target of fromNumber), not the mathematical bound.

    BREAKING CHANGE: replace <Type>.clamp(x) with <Type>.fromNumber(x) for every
    branded number type — e.g. Int16.clamp(100_000) becomes
    Int16.fromNumber(100_000). Num.clamp is not affected.

ts-data-forge@11.0.1

Choose a tag to compare

released this 21 Jul 05:46
Immutable release. Only release title and notes can be modified.
2a75d5c

Patch Changes

  • aec5752: Generate the remaining branded-number modules — the 6 operatorsForFloat
    families (FiniteNumber, NonNegative/NonPositive/NonZero/Positive/
    Negative finite numbers) and the 2 enum modules (Int8, Uint8) — from the
    same declarative generator that already produces the integer modules, so all 34
    branded-number modules are now generated. The generated code is structurally
    identical to the previous hand-written modules (verified by a comment-stripped
    diff), so the runtime and type surface are unchanged; only the JSDoc prose is
    templated (with per-member overrides preserving design-intent notes such as why
    add/sub are absent from NonZeroFiniteNumber). Worked @example blocks are
    still embedded from samples/.

    With every branded-number type now generated, the check:branded-number-casts
    guard is removed — consistency is enforced by generation.

  • bf3466d: Generate the branded-number integer modules (Int, Uint, SafeInt, the
    Int16/32, Uint16/32, NonNegative*, Positive*, NonZero*, NonPositive*
    and Negative* families — 26 modules) from a declarative config
    (scripts/gen-branded-number) instead of maintaining them by hand. The
    generated code is structurally identical to the previous hand-written modules
    (same factory calls, is/as, namespace objects and expectType assertions),
    so the runtime and type surface are unchanged; only the JSDoc prose is now
    produced from flag-driven templates for consistency, with worked @example
    blocks still embedded from samples/. Generation runs as part of the build.

    The operatorsForFloat families and the two enum modules remain hand-written
    for now and continue to be covered by check:branded-number-casts.