Skip to content

Commit

Permalink
Added changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed May 27, 2024
1 parent 1f6738c commit 6574858
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .changeset/rude-knives-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@total-typescript/ts-reset": minor
---

Added a rule, `/map-constructor`, to default `Map` to `Map<unknown, unknown>` when no arguments are passed to the constructor.

Before, you'd get `any` for both key and value types. Now, the result of `Map.get` is `unknown` instead of `any`:

```ts
const userMap = new Map();

const value = userMap.get("matt"); // value: unknown
```

This now is part of the recommended rules.

0 comments on commit 6574858

Please sign in to comment.