@vllnt/typescript 2.0.1 → 3.0.0-canary.f8310f4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ All notable changes to this project are documented in this file. The format foll
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [3.0.0] - 2026-11-16
8
+
9
+ ### Added
10
+
11
+ - `base.json` enables `noImplicitOverride`, `noImplicitReturns`, `noFallthroughCasesInSwitch` and `exactOptionalPropertyTypes`, so every preset inherits them. Fixtures in `tests/fixtures/flags` prove under TypeScript 6 and 7, in every preset, that each flag is active and is the only cause of its diagnostic, and that JavaScript output is the same with the flags on and off.
12
+
13
+ ### Changed
14
+
15
+ - Bumped the Next.js integration fixture from 16.4.3 to 16.4.5. Next 16.4.3 is inside the range of a published security advisory (`>=16.3.0 <=16.4.4`), and Next refuses to build with it.
16
+
17
+ ### Breaking
18
+
19
+ The flags add diagnostics and leave JavaScript output unchanged, but inferred declarations can differ (see the last flag below). This is a major change under the Versioning policy. See [Migrating from version 2](README.md#migrating-from-version-2).
20
+
21
+ - `noImplicitOverride`: a method that replaces a base-class method needs the `override` modifier (TS4114).
22
+ - `noImplicitReturns`: a function that returns a value on some paths must return on all of them (TS7030). Add the missing `return`, or `return undefined;`.
23
+ - `noFallthroughCasesInSwitch`: a non-empty `case` must end with `break`, `return` or `throw` (TS7029). Empty cases that share a body are unaffected.
24
+ - `exactOptionalPropertyTypes`: `prop?: T` no longer accepts an explicit `undefined` (TS2375, TS2379, TS2322). Write `prop?: T | undefined`, or leave the key out.
25
+ - Declaration emit under `exactOptionalPropertyTypes`: the `.d.ts` that TypeScript infers can differ. For example, an inferred `count?: number | undefined` is emitted as `count?: number`. Libraries that publish declarations should compare their `.d.ts` output when upgrading.
26
+ - To adopt them one at a time, set a flag to `false` in your own `compilerOptions` after `extends`.
27
+
7
28
  ## [2.0.1] - 2026-11-16
8
29
 
9
30
  ### Changed
package/README.md CHANGED
@@ -10,7 +10,7 @@ is required. Extend a preset, then supply project-specific paths and ambient typ
10
10
  For TypeScript 7 projects:
11
11
 
12
12
  ```sh
13
- pnpm add --save-dev @vllnt/typescript@^2 typescript@^7
13
+ pnpm add --save-dev @vllnt/typescript@^3 typescript@^7
14
14
  ```
15
15
 
16
16
  For tools that still require the TypeScript JavaScript API, install TypeScript 7 as the build compiler and TypeScript 6 under the canonical package name:
@@ -19,7 +19,7 @@ For tools that still require the TypeScript JavaScript API, install TypeScript 7
19
19
  {
20
20
  "devDependencies": {
21
21
  "@typescript/native": "npm:typescript@^7.0.2",
22
- "@vllnt/typescript": "^2.0.0",
22
+ "@vllnt/typescript": "^3.0.0",
23
23
  "typescript": "npm:@typescript/typescript6@^6.0.2"
24
24
  }
25
25
  }
@@ -102,6 +102,10 @@ Every specialized preset inherits:
102
102
  - `isolatedModules: true`
103
103
  - `noUncheckedIndexedAccess: true`
104
104
  - `noUncheckedSideEffectImports: true`
105
+ - `noImplicitOverride: true`
106
+ - `noImplicitReturns: true`
107
+ - `noFallthroughCasesInSwitch: true`
108
+ - `exactOptionalPropertyTypes: true`
105
109
  - `forceConsistentCasingInFileNames: true`
106
110
  - `skipLibCheck: true`
107
111
  - `esModuleInterop: true`
@@ -114,6 +118,38 @@ Ambient type packages are intentionally opt-in. List every required package in t
114
118
 
115
119
  `stableTypeOrdering` aligns TypeScript 6 output with TypeScript 7. It can make TypeScript 6 type-checking slower; TypeScript 7 always uses stable ordering.
116
120
 
121
+ ## Migrating from version 2
122
+
123
+ Version 3 turns on four more flags in `base.json`, so every preset inherits them. Each one adds diagnostics, and none changes JavaScript output. `exactOptionalPropertyTypes` can change inferred declarations (see below). Run `tsc --noEmit` after upgrading and fix what it reports:
124
+
125
+ | Flag | What it catches | Usual fix |
126
+ | ---------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
127
+ | `noImplicitOverride` | A method that replaces a base-class method without saying so (TS4114) | Add the `override` modifier, or rename the method if it was not meant to replace the base one. |
128
+ | `noImplicitReturns` | A function that returns a value on some paths and falls off the end on others (TS7030) | Add the missing `return` (`return undefined;` if that is intended). |
129
+ | `noFallthroughCasesInSwitch` | A non-empty `case` that runs into the next one (TS7029) | End the case with `break`, `return` or `throw`. Empty cases that share a body are still allowed. |
130
+ | `exactOptionalPropertyTypes` | Assigning `undefined` to a property declared `prop?: T` (TS2375, TS2379, TS2322) | Write `prop?: T \| undefined` if `undefined` is a valid value, or leave the key out when there is no value. |
131
+
132
+ `exactOptionalPropertyTypes` is the one most likely to need many edits. `prop?: T` now means "the key may be missing", not "the value may be undefined":
133
+
134
+ ```ts
135
+ interface Options {
136
+ name?: string;
137
+ }
138
+
139
+ const a: Options = { name: undefined }; // error
140
+ const b: Options = {}; // omit the key
141
+
142
+ function build(name: string | undefined): Options {
143
+ return name === undefined ? {} : { name }; // add the key only when it is set
144
+ }
145
+ ```
146
+
147
+ The same applies to call arguments and to props you pass to libraries: `use({ name: undefined })` is an error when the parameter's type does not list `undefined`. Widen your own types, or build the object without the key.
148
+
149
+ `exactOptionalPropertyTypes` also changes declaration emit. When TypeScript infers a type that has an optional property, it now prints `count?: number` where it used to print `count?: number | undefined`. Types you annotate yourself are copied as written. If you publish a library, compare the `.d.ts` files before and after upgrading.
150
+
151
+ To adopt the flags one at a time, set the ones you are not ready for to `false` in your own `compilerOptions` (after `extends`) and remove the override as you fix each one. The fixtures in `tests/fixtures/flags` show a failing and an accepted form of each pattern.
152
+
117
153
  ## Migrating from version 1
118
154
 
119
155
  Version 2 supports TypeScript `>=6.0.2 <8` and drops TypeScript 5. Before upgrading:
@@ -134,7 +170,7 @@ TypeScript 7 also removes ES5 targeting, legacy module formats and resolution, `
134
170
  | Node.js consumers | `>=22` |
135
171
  | TypeScript | `>=6.0.2 <8` |
136
172
  | Tested compilers | TypeScript 6 compatibility package and TypeScript 7.0.2 |
137
- | Next.js integration | 16.4.3 |
173
+ | Next.js integration | 16.4.5 |
138
174
  | React integration | 19.3.1 |
139
175
  | Repository development | Node.js 22.13+, pnpm 11.28.8 |
140
176
 
@@ -146,7 +182,7 @@ pnpm check
146
182
  pnpm pack --dry-run
147
183
  ```
148
184
 
149
- The checks compile every preset with TypeScript 6 and 7, verify declaration emit, install and compile the packed package, enforce full test-helper coverage, and build real React/Vite and Next.js fixtures.
185
+ The checks compile every preset with TypeScript 6 and 7, prove that each inherited strictness flag is active, verify declaration emit, install and compile the packed package, enforce full test-helper coverage, and build real React/Vite and Next.js fixtures.
150
186
 
151
187
  ## Versioning
152
188
 
@@ -161,7 +197,7 @@ The checks compile every preset with TypeScript 6 and 7, verify declaration emit
161
197
  - [Contributing](CONTRIBUTING.md) · [Issues](https://github.com/vllnt/typescript/issues)
162
198
  - [Security policy and private reporting](SECURITY.md)
163
199
 
164
- npm `latest` is stable `2.0.0` at this audit. `@canary` selects moving prereleases;
200
+ npm `latest` is stable `3.0.0` at this audit. `@canary` selects moving prereleases;
165
201
  pin and test them before adoption. The compatibility matrix above describes
166
202
  this version's tested integrations, not a requirement to use every framework.
167
203
 
package/base.json CHANGED
@@ -9,6 +9,10 @@
9
9
  "skipLibCheck": true,
10
10
  "noUncheckedIndexedAccess": true,
11
11
  "noUncheckedSideEffectImports": true,
12
+ "noImplicitOverride": true,
13
+ "noImplicitReturns": true,
14
+ "noFallthroughCasesInSwitch": true,
15
+ "exactOptionalPropertyTypes": true,
12
16
  "stableTypeOrdering": true,
13
17
  "types": [],
14
18
  "libReplacement": false,
package/llms.txt CHANGED
@@ -9,7 +9,7 @@
9
9
  - License: MIT
10
10
 
11
11
  Install independently in any project; no vllnt monorepo is required. npm latest
12
- is stable 2.0.0 at this audit; canary is a moving prerelease channel. Pin and test
12
+ is stable 3.0.0 at this audit; canary is a moving prerelease channel. Pin and test
13
13
  prereleases. See [Contributing](CONTRIBUTING.md) and the [Security policy](SECURITY.md).
14
14
 
15
15
  ## Compatibility
@@ -29,3 +29,16 @@ prereleases. See [Contributing](CONTRIBUTING.md) and the [Security policy](SECUR
29
29
 
30
30
  Consumers should list required ambient packages in `types` and set `rootDir` in emitting projects.
31
31
  Emitting presets do not enable `incremental`, so a clean build emits every output even when a `.tsbuildinfo` file is left over. Projects that set `incremental: true` should delete the `.tsbuildinfo` file with the output directory before a clean build.
32
+
33
+ ## Strictness inherited from base.json
34
+
35
+ Every preset enables `strict`, `noUncheckedIndexedAccess`, `noUncheckedSideEffectImports`, `noImplicitOverride`, `noImplicitReturns`, `noFallthroughCasesInSwitch` and `exactOptionalPropertyTypes`.
36
+
37
+ Migrating from version 2 (the last four flags are new):
38
+
39
+ - `noImplicitOverride` (TS4114): add `override` to a method that replaces a base-class method.
40
+ - `noImplicitReturns` (TS7030): return on every path; use `return undefined;` when that is intended.
41
+ - `noFallthroughCasesInSwitch` (TS7029): end a non-empty `case` with `break`, `return` or `throw`.
42
+ - `exactOptionalPropertyTypes` (TS2375, TS2379, TS2322): write `prop?: T | undefined` where `undefined` is a valid value, or omit the key.
43
+ - JavaScript output does not change. Under `exactOptionalPropertyTypes`, inferred declarations can: `count?: number | undefined` is emitted as `count?: number`.
44
+ - To adopt them gradually, set a flag to `false` in the project's own `compilerOptions` after `extends`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vllnt/typescript",
3
- "version": "2.0.1",
3
+ "version": "3.0.0-canary.f8310f4",
4
4
  "description": "Shared TypeScript configurations for vllnt projects",
5
5
  "license": "MIT",
6
6
  "author": {