Skip to content

Update typedoc from v0.15 to v20.20 - #333

Merged
Gudahtt merged 2 commits into
developfrom
update-typedoc
Feb 4, 2021
Merged

Gudahtt merged 2 commits into
developfrom
update-typedoc

Conversation

@Gudahtt

@Gudahtt Gudahtt commented Feb 2, 2021 •

Copy link
Copy Markdown
Member

This update had a few breaking changes, most of which were introduced in v20. The options were moved into a separate config file, and some of them were no longer required.

This update includes a variety of improvements and bug fixes.

@Gudahtt
Gudahtt requested a review from a team as a code owner February 2, 2021 22:43
This update had a few breaking changes, most of which were introduced
in v20 [1]. The options were moved into a separate config file, and
some of them were no longer required.

This update includes a variety of improvements and bug fixes.

[1]: https://github.com/TypeStrong/typedoc/releases/tag/v0.20.0

@rickycodes rickycodes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gudahtt
Gudahtt merged commit f3d4ddf into develop Feb 4, 2021
@Gudahtt
Gudahtt deleted the update-typedoc branch February 4, 2021 01:50
Mrtenz pushed a commit that referenced this pull request Oct 16, 2025
* Request validation should not throw if verifyingContract is not defined in typed signature (#328) (#330)

* 14.0.1 (#331)

* [14.x] fix: support ethermint's EIP712 implementation (#333)

* setting cosmos as allowed string for verifyingContract field

* fixed and linter

* readability

* Update condition to match main branch

* Remove duplicate copy of test

---------

Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Version 14.0.2 (#339)

* Version 14.0.2

* Fix typo

Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>

---------

Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>

---------

Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
Co-authored-by: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com>
Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
amitabh94 pushed a commit to amitabh94/core that referenced this pull request Jun 16, 2026
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Sep 13, 2026
Top of stack MetaMask#331, on MetaMask#325. Mirrors
[MetaMask#10019](MetaMask#10019), the
last of core's foundational chain.

| | Before | After |
| --- | --- | --- |
| `target` | `ES2020` | `ES2022` |
| `lib` | `["ES2020", "DOM"]` | `["ES2022", "DOM"]` |

Correctly last in the order: raising the emit target is only defensible
once the Node floor guarantees the runtime supports it, which MetaMask#328
established.

## It is not cosmetic

`wrapError` sets `cause` behind two `@ts-ignore` comments, with this
note in the source:

> Error causes are not supported by our current tsc target (ES2020, we
need ES2022 to make this work)

`Error.cause` is ES2022, so both suppressions are now obsolete and are
removed. The types are genuine rather than ignored.

The evidence came from enabling test type checking: with `lib: ES2020` a
`tsc` pass over the tests reports **11 errors**, nearly all `Property
'cause' does not exist`. With `lib: ES2022` it reports **zero**. That is
why the type checking PR stacks on top of this one rather than below it.

## Verification

Build, tests, tsd, eslint and lint all pass.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking for consumers on older runtimes or TS configs that assumed
ES2020 output; error utilities are widely used but the change is
configuration and type hygiene rather than new logic.
> 
> **Overview**
> **BREAKING:** Raises the TypeScript **`target`** and **`lib`** from
**ES2020** to **ES2022**, so published output expects a modern runtime
or bundler that can consume ES2022. The unreleased changelog documents
this alongside the existing Node/ESM breaking changes.
> 
> In **`wrapError`**, the **`Error(message, { cause })`** path no longer
needs **`@ts-ignore`** or the comment about ES2020 lacking
**`Error.cause`** types—ES2022 **`lib`** makes **`cause`** a first-class
typed option.
> 
> No runtime behavior change in **`wrapError`** beyond what was already
implemented; this is primarily a compile/emit floor and type-checking
cleanup that unblocks stricter test **`tsc`** (e.g. **`cause`** on
errors) in follow-up work.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
6242b3e584a89dd8a4adf7a3c06c8439ab6ede4b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Sep 13, 2026
Top of stack MetaMask#331, on MetaMask#333. Opts this package into the progressive test
type checking rollout core is doing (16 of its 100 packages so far).

## Tests were not type checked at all

Verified by injecting `const deliberateTypeError: number = "a string"`
into a test file:

| Check | Result |
| --- | --- |
| `yarn build` | passes, `tsconfig.build.json` excludes tests |
| `yarn test:source` | passes, see below |
| `yarn test:types` | passes, tsd only reads `*.test-d.ts` |
| `yarn lint` | passes |

`test:source` can never catch it: `isolatedModules` puts ts-jest on its
`transpileModule` path, which erases types without checking them.

## The change

```
lint:tsc = tsc --noEmit --project tsconfig.lint.json     ← added to `lint`
```

`tsconfig.lint.json` extends `tsconfig.json` (which already covers
everything the build does not) and adds `skipLibCheck`, because
dependency declarations do not satisfy the strict flags used here.

## Why `*.test-d.ts` is excluded

Those belong to `tsd`, which checks them itself via `yarn test:types`
(fixed in MetaMask#322). Including them here pulls `tsd`'s own types into the
program, and those reach `type-fest`, whose `basic.d.ts` carries `///
<reference lib="esnext" />`. That silently widens built in types past
this package's `lib`, producing a spurious failure where `FrozenSet` no
longer satisfies `ReadonlySet` because of Set methods we do not target.
Traced with `tsc --explainFiles`.

## Why this stacks on ES2022

With `lib: ES2020` a `tsc` pass over the tests reports **11 errors**,
nearly all `Property 'cause' does not exist`. With `lib: ES2022`,
**zero**. MetaMask#333 has to land first.

## Confirmed not vacuous

A deliberate type error in a test file now exits non-zero with `TS2322`,
and `tsd` still independently catches a bad `expectAssignable` in a
`.test-d.ts` file.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Dev-only lint and TypeScript config changes; no runtime or shipped
library behavior changes.
> 
> **Overview**
> **`yarn lint` now runs TypeScript on test and other non-build code**
through a new `lint:tsc` script, closing a gap where
`tsconfig.build.json` and transpile-only Jest never validated types in
`*.test.ts` files.
> 
> A new **`tsconfig.lint.json`** extends the root config with
`skipLibCheck`, incremental **`emitDeclarationOnly`** output under
**`.tsc-lint-cache/`** (gitignored and ignored by ESLint), and an
**exclude** for **`*.test-d.ts`** so `tsd`-owned type tests are not
double-checked or polluted by `tsd`’s wider `lib` types.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
670fa8aa1187a15a6935a75ea693271e6e4e1fb5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants