Five small holes closed: imports the transform writes, tsconfig flags, every any the library hands out, a g regex tested again (regex-last-index) #142

Merged
sionzee merged 20 commits from small-gaps into main 2026-11-23 13:32:44 +01:00
Owner

Based on shared-copies (#141), and contains it: the diff shown is this piece alone.

Five small holes, each confirmed on the binary before anything was built. Four came from an outside audit of main; the transform bug turned up while reviewing #140. Each of these passes tsc strict, safe-ts check --idiomatic --deny-warnings and oxlint, except the first, which does not build at all:

import * as R from "@evobug_com/safe-ts-std/result";
const v = R.q(parse(n));          // the transform wrote `import * as R from "…";, Err as __qErr`: a syntax error

// tsconfig.json: { "strict": false }   -> `safe-ts check` said nothing; Option<T> is then just T

const p = Object.getPrototypeOf(o);
p.name.first;                     // `any` from the library: nothing is checked from here on

class Finder {
  private readonly re = /\d+/g;
  has(s: string): boolean {
    return this.re.test(s);       // true, false, true, false for the same text
  }
}

What changes

The transform's added imports parse for every shape of an import of std. q, match, parseJson / validate and arbitrary write their own import { … } statement in front of the import std was found through; they no longer paste names into its text. A test transforms thirteen shapes (namespaces, a default with braces, import type next to a value import, two imports of one module, the prelude with no import) and type-checks each.

A setup warning for each compiler flag a guarantee depends on. strict left off, each of its members set to false on its own, and exactOptionalPropertyTypes left off, following extends. Each is tied to a program in the tests: accepted by tsc with the flag off, refused with it on, silent in safe-ts check, and wrong when it runs. The adoption guide has the table.

Every any TypeScript's declarations hand out is accounted for. A test reads the lib files of the documented setup and Node's types and lists each member where code receives any: 962 of them. Each must be in one of three places, or the test fails, so a TypeScript upgrade that adds one shows up:

  • retyped in std's strict lib (26): Object.getPrototypeOf, Object.values / entries of a type without an index, Object.assign of four sources, property descriptors, Reflect.apply / construct, the callbacks of JSON.stringify and replace, a PromiseLike's rejection reason;
  • reported by no-hidden-any (31), which now follows the receiver however it is written: controller.signal.reason, a field, an element, a map's value, a call's declared return type, and a value typed Option<T>;
  • on an allow-list with its reason (905). Nearly half are event handler properties, where => any is what the code's own handler may return.

New rule regex-last-index (error, with a quick fix). test or exec on a regex with g or y run again with the lastIndex the last call left: a field used in a method, a local in a loop over other strings, in a callback. The idiom the flag exists for (while ((m = re.exec(text)) !== null) over one string), matchAll, replace and split are silent.

Measured and left: toISOString() on a date made from a number. On an adopter's project all eight such sites take their time from a clock. A number that came from parsing is already reported; what is left is "who made this date", which a rule reading one function cannot answer. The gap is written down in the builtins guide and as an escaping class in the corpus.

Evidence

  • Held-out cases, written by the reviewer and not shown to the implementer.
    • The transform: std through two namespaces with q, a mapper and match; a renamed import next to a namespace; a file without semicolons. Each emits a program that runs and gives the right answers.
    • regex-last-index: 9 of 9 forms reported, 8 fine forms silent.
    • Library any: 12 of 12 reads refused by tsc or reported; the typed overloads still work.
    • no-hidden-any receivers: 21 of 22 forms reported, 5 reads of a project's own field with the same name silent. The one not reported at the read is an optional CustomEvent field, which is reported where its type is written.
    • tsconfig: five setups; the documented one and one through extends with comments stay free of warnings.
  • Three rounds. The first version also warned when verbatimModuleSyntax or erasableSyntaxOnly is off. I had those taken out: what they prevent is a module that fails to load under Node's own type stripping, which is loud, and this repository's own docs use parameter properties, which one of them refuses. They are now a recommendation for code Node runs itself. The first version of no-hidden-any also read its table only off an annotated binding, so the commonest read of a signal's reason, through its controller, was silent; the second saw AbortSignal | undefined and not Option<AbortSignal>, the spelling prefer-option asks for.
  • On an adopter's project (about 760 files): no finding changes and no new setup warning. Its 174 .reason reads are all of its own types.
  • Soundness corpus: two classes added and closed (lib-any-reaches-code, regex-last-index-reused), one added and left open on purpose (date-from-unchecked-number). 17 of 108 escape.
  • Cost: about +0.4% instructions for a whole check of that project's largest entry (17.58 to 17.65 billion, one thread, callgrind, median of three runs each). Runs of one binary differ by up to 0.8% here, so the piece costs about as much as the measurement can resolve; the implementer measured +0.5 to +0.8%. The work guard passes without new ceilings.

What turns red on upgrade

  • With std's strict lib loaded, tsc refuses reads it used to let through as any. The changelog lists each retyped member with what to write: give Object.values(x) a Record type first; annotate or check a replace callback's captures; compare or check what Object.getPrototypeOf gives.
  • regex-last-index is an error. Drop the flag where test is the only use (the quick fix), or set lastIndex.
  • A project with strict off, one of its members off, or exactOptionalPropertyTypes off gets a setup warning, which --deny-warnings counts.

For the owner to decide

  • Whether SAFE-TS should require verbatimModuleSyntax and erasableSyntaxOnly. Requiring them means rewriting seven docs examples and 22 fixture lines that use parameter properties, and a warning for every project on today's documented setup.
  • skipLibCheck. With it on, a declaration that imports a missing package is silently any, a real hole. But nearly every scaffold turns it on, and turning it off reports errors in third-party declarations a project cannot fix. Left out of the warnings.
  • A Node stream's chunks. stream.on("data", (chunk) => …) hands out any, and the strict lib cannot retype Node's declarations. The adopter has 27 such calls; the checker could type the receiver at 5, and 25 of the 27 annotate the chunk : Buffer, a claim nothing checks. A finding would ask for await text(stream) from node:stream/consumers, or (chunk: unknown) with a check. Nothing built.

What stays unseen

  • no-hidden-any: a receiver narrowed by a test, what a lib function returns (AbortSignal.timeout(ms).reason), a package's value, a table property called through such a receiver, and a generic alias of a list of such values.
  • The 905 allow-listed members real code reaches: Node stream chunks, IndexedDB results, WebGL getters, an iterator's return value read by hand.
  • regex-last-index: flags that are not written where the regex is made.

Created with Claude Opus 5.5 (implementation) and Claude Fable 5.2 (review and acceptance tests) in Claude Code.

Based on `shared-copies` (#141), and contains it: the diff shown is this piece alone. Five small holes, each confirmed on the binary before anything was built. Four came from an outside audit of `main`; the transform bug turned up while reviewing #140. Each of these passes `tsc` strict, `safe-ts check --idiomatic --deny-warnings` and oxlint, except the first, which does not build at all: ```ts import * as R from "@evobug_com/safe-ts-std/result"; const v = R.q(parse(n)); // the transform wrote `import * as R from "…";, Err as __qErr`: a syntax error // tsconfig.json: { "strict": false } -> `safe-ts check` said nothing; Option<T> is then just T const p = Object.getPrototypeOf(o); p.name.first; // `any` from the library: nothing is checked from here on class Finder { private readonly re = /\d+/g; has(s: string): boolean { return this.re.test(s); // true, false, true, false for the same text } } ``` ## What changes **The transform's added imports parse for every shape of an import of std.** `q`, `match`, `parseJson` / `validate` and `arbitrary` write their own `import { … }` statement in front of the import std was found through; they no longer paste names into its text. A test transforms thirteen shapes (namespaces, a default with braces, `import type` next to a value import, two imports of one module, the prelude with no import) and type-checks each. **A setup warning for each compiler flag a guarantee depends on.** `strict` left off, each of its members set to `false` on its own, and `exactOptionalPropertyTypes` left off, following `extends`. Each is tied to a program in the tests: accepted by `tsc` with the flag off, refused with it on, silent in `safe-ts check`, and wrong when it runs. The adoption guide has the table. **Every `any` TypeScript's declarations hand out is accounted for.** A test reads the lib files of the documented setup and Node's types and lists each member where code receives `any`: 962 of them. Each must be in one of three places, or the test fails, so a TypeScript upgrade that adds one shows up: - retyped in std's strict lib (26): `Object.getPrototypeOf`, `Object.values` / `entries` of a type without an index, `Object.assign` of four sources, property descriptors, `Reflect.apply` / `construct`, the callbacks of `JSON.stringify` and `replace`, a `PromiseLike`'s rejection reason; - reported by `no-hidden-any` (31), which now follows the receiver however it is written: `controller.signal.reason`, a field, an element, a map's value, a call's declared return type, and a value typed `Option<T>`; - on an allow-list with its reason (905). Nearly half are event handler properties, where `=> any` is what the code's own handler may return. **New rule `regex-last-index`** (error, with a quick fix). `test` or `exec` on a regex with `g` or `y` run again with the `lastIndex` the last call left: a field used in a method, a local in a loop over other strings, in a callback. The idiom the flag exists for (`while ((m = re.exec(text)) !== null)` over one string), `matchAll`, `replace` and `split` are silent. **Measured and left: `toISOString()` on a date made from a number.** On an adopter's project all eight such sites take their time from a clock. A number that came from parsing is already reported; what is left is "who made this date", which a rule reading one function cannot answer. The gap is written down in the builtins guide and as an escaping class in the corpus. ## Evidence - **Held-out cases, written by the reviewer and not shown to the implementer.** - The transform: std through two namespaces with `q`, a mapper and `match`; a renamed import next to a namespace; a file without semicolons. Each emits a program that runs and gives the right answers. - `regex-last-index`: 9 of 9 forms reported, 8 fine forms silent. - Library `any`: 12 of 12 reads refused by `tsc` or reported; the typed overloads still work. - `no-hidden-any` receivers: 21 of 22 forms reported, 5 reads of a project's own field with the same name silent. The one not reported at the read is an optional `CustomEvent` field, which is reported where its type is written. - tsconfig: five setups; the documented one and one through `extends` with comments stay free of warnings. - **Three rounds.** The first version also warned when `verbatimModuleSyntax` or `erasableSyntaxOnly` is off. I had those taken out: what they prevent is a module that fails to load under Node's own type stripping, which is loud, and this repository's own docs use parameter properties, which one of them refuses. They are now a recommendation for code Node runs itself. The first version of `no-hidden-any` also read its table only off an annotated binding, so the commonest read of a signal's reason, through its controller, was silent; the second saw `AbortSignal | undefined` and not `Option<AbortSignal>`, the spelling `prefer-option` asks for. - **On an adopter's project (about 760 files):** no finding changes and no new setup warning. Its 174 `.reason` reads are all of its own types. - **Soundness corpus:** two classes added and closed (`lib-any-reaches-code`, `regex-last-index-reused`), one added and left open on purpose (`date-from-unchecked-number`). 17 of 108 escape. - **Cost:** about +0.4% instructions for a whole check of that project's largest entry (17.58 to 17.65 billion, one thread, callgrind, median of three runs each). Runs of one binary differ by up to 0.8% here, so the piece costs about as much as the measurement can resolve; the implementer measured +0.5 to +0.8%. The work guard passes without new ceilings. ## What turns red on upgrade - **With std's strict lib loaded, `tsc` refuses reads it used to let through** as `any`. The changelog lists each retyped member with what to write: give `Object.values(x)` a `Record` type first; annotate or check a `replace` callback's captures; compare or check what `Object.getPrototypeOf` gives. - `regex-last-index` is an error. Drop the flag where `test` is the only use (the quick fix), or set `lastIndex`. - A project with `strict` off, one of its members off, or `exactOptionalPropertyTypes` off gets a setup warning, which `--deny-warnings` counts. ## For the owner to decide - **Whether SAFE-TS should require `verbatimModuleSyntax` and `erasableSyntaxOnly`.** Requiring them means rewriting seven docs examples and 22 fixture lines that use parameter properties, and a warning for every project on today's documented setup. - **`skipLibCheck`.** With it on, a declaration that imports a missing package is silently `any`, a real hole. But nearly every scaffold turns it on, and turning it off reports errors in third-party declarations a project cannot fix. Left out of the warnings. - **A Node stream's chunks.** `stream.on("data", (chunk) => …)` hands out `any`, and the strict lib cannot retype Node's declarations. The adopter has 27 such calls; the checker could type the receiver at 5, and 25 of the 27 annotate the chunk `: Buffer`, a claim nothing checks. A finding would ask for `await text(stream)` from `node:stream/consumers`, or `(chunk: unknown)` with a check. Nothing built. ## What stays unseen - `no-hidden-any`: a receiver narrowed by a test, what a lib function returns (`AbortSignal.timeout(ms).reason`), a package's value, a table property called through such a receiver, and a generic alias of a list of such values. - The 905 allow-listed members real code reaches: Node stream chunks, IndexedDB results, WebGL getters, an iterator's return value read by hand. - `regex-last-index`: flags that are not written where the regex is made. Created with Claude Opus 5.5 (implementation) and Claude Fable 5.2 (review and acceptance tests) in Claude Code.
Open: q(...), match(...), parseJson<T>/validate<T> and arbitrary<T>() added the
std names they need (Err, mapErr, unreachable, the JSON and generator
runtimes) by appending ", X as __x" to the text of the import specifier they
found std in. That is right only inside a braced list: with std reached
through a namespace (`import * as R from ".../result"; R.q(...)`), the
specifier is the one spelling::normalize adds, written nowhere, at the end of
the namespace import, and the build wrote `import * as R from "...";, Err as
__qErr`, which doesn't parse.

Closed: each rewrite writes an import of its own (`ImportSite::import`) in
front of the declaration it found std in, on the same line; for a declaration
normalize added, in front of the namespace import it stands for. A test
transforms each shape (namespace with and without a semicolon, with a
mapper, match and parseJson and arbitrary through a namespace, a default and
braces, import type next to a value import, two imports of one module, an
inline type specifier, and with the prelude: no import, import type only,
empty brace lists, a namespace) and gives the programs to tsc, strict. The
other rewrites (enum constructors, loops, @inline, dev checks) add no import:
dev checks name __qErr, which q's rewrite imports. Expected outputs in
tests/transform.rs that pinned the appended names now pin the new statement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: tsconfig.rs looked at noUncheckedIndexedAccess only, so a project with
"strict": false (or strictNullChecks, strictFunctionTypes, ... off on their
own) checked clean, while every one of those lets a program through tsc that
the rules assume tsc refuses.

Closed: tsconfig::flag_warnings, through extends and a solution file's
projects (one having the flag is enough, as for strict-lib): strict off is one
warning naming the members it leaves off (TypeScript 6+ turns strict on when
unset; the version is read from the typescript package installed above the
entry, and nothing is said when none is), a member off on its own is one
warning, and exactOptionalPropertyTypes, verbatimModuleSyntax and
erasableSyntaxOnly left off are one each. Each says what goes wrong. Computed
once per tsconfig (a directory's every file is an entry; the work guard saw
the repeated reads). tests/tsconfig_flags.rs shows each flag with a program
tsc accepts with it off and refuses with it on, which the checker reports
nothing in. Left out, with reasons on the docs page: skipLibCheck (a real
hole, but turning it off reports errors in third-party declarations),
noImplicitOverride (no rule finds an override by its keyword),
noFallthroughCasesInSwitch, noPropertyAccessFromIndexSignature, alwaysStrict.

The examples, the corpus's projects and the migration skill's template set
the two module flags; the corpus still has 16 of 105 classes escaping. The CLI
test's tsconfig gains the documented flags, and the resolution tests filter
every tsconfig flag warning, not only noUncheckedIndexedAccess's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: Object.getPrototypeOf, Reflect.construct of arguments that don't fit, a
property descriptor's value and Object.assign of four sources compiled with an
any under the documented setup, and no-hidden-any said nothing. Those four were
found by reading; nothing found the rest.

Closed: tests/lib_any.rs reads the declarations of the documented setup
(lib.esnext.full.d.ts and every lib it references; @types/node) with oxc and
lists each member with any where code receives it (a return, a property, a
callback's parameter, a type parameter defaulting to any), read with polarity
so an any a member only accepts isn't listed. Each must be retyped in
strict-lib, known to no-hidden-any (hidden_any::members), or listed in
tests/lib-any/allowed.txt with the reason; the test fails otherwise, and on a
stale line. 962 members: 26 retyped, 31 reported, 905 allowed.

strict-lib now retypes Object.getPrototypeOf / setPrototypeOf / Object(value),
Object.assign of four sources, Object.values / entries of a type without an
index, the descriptor methods (Object.getOwnPropertyDescriptor(s),
Reflect.getOwnPropertyDescriptor), Reflect.apply / construct, the JSON.stringify
replacer's values, the replace / replaceAll callback's captures and
PromiseLike.then's reason; strict-lib.check.ts proves each. no-hidden-any
reports PropertyDescriptor value/get, AbortSignal.reason, AggregateError.errors,
SuppressedError error/suppressed, Window.opener of annotated bindings and
window.opener (a type may have several such properties now).

std's json-tables.test.ts read Object.values of a union of tables as any: it
gives the table a record type now. Soundness corpus: lib-any-reaches-code, all
six programs escaping before, rejected by tsc now. On an adopter and the
examples: no finding changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: a regex with the g or y flag kept in a class field or a local and tested
again (in a method, a loop over other strings, a callback) starts where the
last match ended: test answers true, false, true for one text. Only a
module-level one was reported (no-mutable-global).

Closed: the rule regex-last-index (regex_state.rs, per file), an error. The
regex is known by how it is made (a literal, new RegExp(x, "g") with the flags
written) and kept (a const or let of a function, a parameter's default, a
class field or this.x assigned in the constructor, and a const copy of one).
Reported where nothing sets lastIndex between: a loop over a value it changes,
a callback on what it is given, a field's in a method, a second straight-line
call on another string. Not the idiom: a loop or callback reading one string
(walking its matches), a loop decided by the call and run to its end (it
leaves lastIndex at 0, so what runs it again starts afresh), matchAll,
replace, split, match, a regex made where it is used. Quick fix "Drop the `g`
flag: each test starts at the beginning" where test is every use of a literal
without y (meaning.rs runs it).

Measured: nothing on an adopter (both ways) and the examples; on the installed
packages' JavaScript with a local g regex used by test / exec (11 files), two
findings at first, both the idiom (a tokenizer closure, a substitution loop
adjusting lastIndex), taken as such now, so nothing. Soundness corpus:
regex-last-index-reused, escaping before (3 of 3) and rejected by this rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: new Date(n).toISOString() with n a number that may be NaN or out of
range, and d.toISOString() with d a parameter or a field, aren't reported
(DateState::Number and DateState::Unseen are skipped).

Measured on an adopter (about 760 files) and the examples, by where the date
comes from: 5 toISOString receivers and 3 Intl.DateTimeFormat format(date)
arguments not judged. 1 is Date.now() plus arithmetic (valid), 2 a number
parameter, 1 a number field, 1 a Date property; the arguments a parameter, a
destructured binding and a ?:. Every one is a time from a clock. A number
parsed from text is already reported (and number-parse-nan's); what is left
is who made the number or the date, which a brand could answer and a rule
reading the function can't. So no new report: docs/guide/builtins.md lists
the measurement and the members it covers (toISOString, toTemporalInstant,
the four format methods), the builtins fixture pins the silent forms, and the
soundness corpus gains date-from-unchecked-number, escaping (17 of 108 now).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The message named the regex where it is made (`this.digits`), also when the
call reads it through parentheses or a const copy; it quotes the receiver
the call writes now (`(re).test(...)`, `digitsCopy1.test(...)`), as other
rules do. The full rewrite harness lists the two transformations whose
message text differs from the fixture's, with the reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: verbatimModuleSyntax and erasableSyntaxOnly were warned about and added
to the documented setup. What they prevent is a module that fails to load
under Node's own type stripping, loudly and at once, never under Vite or Bun;
the other flags each let a wrong value through in silence. With
--deny-warnings they turned every project on the earlier documented setup
red, and the docs' own examples use parameter properties.

Closed: flag_warnings warns for strict, its members and
exactOptionalPropertyTypes only. The flags are out of adoption.md's setup and
table, the migration skill's template, examples/demo, examples/react and the
corpus project (which Node runs through the loader, but whose programs gave
the same results with and without them, and which keeps to the documented
setup). adoption.md's Node section recommends them for code Node runs itself,
and lists them among the flags not warned about, with why. On an adopter: no
setup warning about its tsconfigs now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: the property table (ANY_PROPERTIES) reported a read only on a binding
annotated with the type, so signals[0]?.reason, this.signal.reason (a field)
and ctl.signal.reason (the commonest way an AbortSignal's reason is read)
were silent, for the new entries and the old ones alike.

Closed: a read of a table property on a receiver the file can't tell the type
of is a pending read (hidden_any::PendingRead). analyze.rs asks the file's
shapes for the receiver (list.at(i) as an element of the list) and adds the
diagnostic with a TypeSite, Want::NoAnyProperty(property); the whole program
evaluates the shape to a global type (json_value's global_type: a type the
program doesn't declare, through `| undefined`, and a member of a global type
lib declares with one, hidden_any::GLOBAL_MEMBERS: AbortController#signal,
Request#signal), keeps the report naming lib's `Type.property`, and drops it
otherwise, so a project type with a field of that name stays silent. Forms
given: a parameter, a class field (declared or assigned in the constructor), a
getter, an element (index, at, for-of, a callback's), a const, a function's or
method's declared return type (across files), await, ?. and controller.signal.
Not given: narrowing by a test (status === "rejected", instanceof), a lib
function's return (AbortSignal.timeout), a package's value.

Fixtures: twelve reported forms and four silent twins. The rewrite ratchet
loses a miss (no-hidden-any inline-const). On an adopter: no finding changes
(its 174 .reason reads are of its own types).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The whole program's answer for a pending read (Want::NoAnyProperty) now names
the type where the annotated path does (`x.reason` is typed `any`
(`AbortSignal.reason`): ...), with the same help, so a spelling the
normaliser opens (a local alias, Readonly<T>) reads the same either way. The
full rewrite harness lists the one spelling whose message differs, a const
copy of the receiver, quoted as written. The fixture's second function named
`popped` is `poppedAll`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pending reads asked shape.rs for their receivers in a walk of their own,
which cost +1.66% of a check on an adopter's largest entry (4,185 reads of
`state` off its own types, 811 `map.get(key)` calls). Now the sink sites'
shapes and these are found in one walk; a read that is a call's callee isn't
a pending read; and a name declared with a written type that isn't one of the
table's (`game: Mut<Game>`) is judged by the name, as an annotated binding is.
+0.58 to +0.84% over the reference now. A binding typed `AbortSignal |
undefined` is still followed (a fixture pins it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A binding declared with a local alias of a union (`type Signal = AbortSignal |
undefined`, or a generic alias given AbortSignal) went silent: `unaliased`
follows only an alias whose body is a name, an array or a tuple, and the
written-type shortcut took the alias's name for a type of the program. Now
the shortcut leaves a binding typed with a top-level alias that may name a
table type (generic, or its body mentions one) to the whole program, and
`global_type` opens a union alias through its arguments (`written::open`),
with the one type lookup it already makes for the global check. The full
rewrite run lists nothing new for the rule; +0.60% instructions over the
reference on an adopter's largest entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: `task.signal?.reason` with `signal: Option<AbortSignal>`, an
`Option<AbortSignal>` parameter after its check and an
`Option<AbortController>` field were silent, though the same written
`AbortSignal | undefined` were reported. Two causes, both needed: opening
aliases stops at std's own types (`written.rs` knows them by name), so the
evaluation got `Option<AbortSignal>` back unopened; and the written-type
shortcut took `Option<...>` for a type of the program.

Closed: `global_of` (json_value.rs) reads std's `Option<T>` (found in std, or
the prelude's global) as `T | undefined`, and an element of a list whose
element type is a union through the list's written type, flattening the
nested union `noUncheckedIndexedAccess` makes; the shortcut looks inside
`Option<...>` as inside `Mut<...>`. Fixtures: an Option property, parameter,
field and element, a list of `T | undefined`, `const [first] = e.errors`, with
std imported and (a new fixture directory) with the prelude; silent twins with
an Option of a project type. The two generic events are reported where their
type is written (a field's annotation too), which the rule page now says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
no-hidden-any: an element of a list of unions read through the flattened union alone
All checks were successful
Benchmarks / bench (pull_request) Successful in 2m17s
Tests / test (pull_request) Successful in 10m39s
ab7781add1
The element fallback added in the previous commit evaluated the list again
for every element read the first evaluation didn't settle (+0.25% on an
adopter's largest entry); with nested unions flattened, the evaluation's own
answer already gives `Option<AbortSignal>[]` and `(AbortSignal |
undefined)[]` elements, so it goes. A generic alias of such a list
(`type G<T> = readonly (T | undefined)[]`) isn't opened: the rewrite ratchet
lists it, with the reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sionzee changed target branch from shared-copies to main 2026-11-23 13:32:22 +01:00
Merge main: the piece below has landed
Some checks failed
Benchmarks / bench (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
82db044af4
Co-Authored-By: Claude Fable 5.2 <[email protected]>
sionzee deleted branch small-gaps 2026-11-23 13:32:44 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Evobug/Safe-Ts!142
No description provided.