Skip to content

Commit c75ed6d

Browse files
committed
fix: skip-list featureManagement.ts in strict typecheck
Reverts the previous narrow @growthbook type shim — it was incomplete (GrowthBookProvider.tsx imports `Context` and `GrowthBookContextValue` which weren't covered) and was breaking the Next.js full typecheck during build. Following the existing pattern, add featureManagement.ts to the strictSkipList alongside the Customize-new-tab and Copy-audit entries with a comment explaining the bundler-resolution / `exports`-map root cause so it can be addressed in a dedicated cleanup PR.
1 parent 8539d37 commit c75ed6d

3 files changed

Lines changed: 6 additions & 50 deletions

File tree

.claude/scheduled_tasks.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sessionId":"6d012578-9e09-4611-90bf-42657912622d","pid":93274,"procStart":"Tue May 5 16:55:29 2026","acquiredAt":1778017698407}

packages/webapp/custom.d.ts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,3 @@ declare module '*.svg' {
44
const value: SvgrComponent;
55
export default value;
66
}
7-
8-
// `@growthbook/growthbook(-react)` ship .d.ts files in their `dist/` folders,
9-
// but their package.json `exports` map only lists "require"/"import" — under
10-
// `moduleResolution: "bundler"` TypeScript respects `exports` and can no
11-
// longer reach the typings. Declare the subset we actually consume so type
12-
// imports keep resolving without falling back to `any`.
13-
declare module '@growthbook/growthbook' {
14-
export type JSONValue =
15-
| null
16-
| number
17-
| string
18-
| boolean
19-
| Array<JSONValue>
20-
| { [key: string]: JSONValue };
21-
export type WidenPrimitives<T> = T extends string
22-
? string
23-
: T extends number
24-
? number
25-
: T extends boolean
26-
? boolean
27-
: T;
28-
export interface FeatureDefinition<T = unknown> {
29-
defaultValue?: T;
30-
rules?: unknown[];
31-
}
32-
export type Experiment = Record<string, unknown>;
33-
export type Result = Record<string, unknown>;
34-
export interface GrowthBook {
35-
[key: string]: unknown;
36-
}
37-
export const GrowthBook: {
38-
new (options?: unknown): GrowthBook;
39-
};
40-
}
41-
42-
declare module '@growthbook/growthbook-react' {
43-
export interface GrowthBook {
44-
[key: string]: unknown;
45-
}
46-
export const GrowthBook: {
47-
new (options?: unknown): GrowthBook;
48-
};
49-
export const GrowthBookProvider: React.FC<{
50-
children?: React.ReactNode;
51-
growthbook?: GrowthBook;
52-
}>;
53-
export function useFeatureValue<T>(key: string, fallback: T): T;
54-
export function useGrowthBook(): GrowthBook | undefined;
55-
export function useFeatureIsOn(key: string): boolean;
56-
}

scripts/typecheck-strict-changed.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ const strictSkipList = new Set([
5858
// string handling / null returns) and should be addressed separately.
5959
'packages/extension/src/newtab/DndModal.tsx',
6060
'packages/webapp/pages/jobs/[id]/questions.tsx',
61+
// featureManagement re-imports `@growthbook/growthbook` types, but
62+
// moduleResolution: "bundler" (PR #5952) respects the package's `exports`
63+
// map which omits a "types" condition, so type imports fall back to
64+
// implicit any under strict mode. Touched here to add the personas flag.
65+
'packages/shared/src/lib/featureManagement.ts',
6166
]);
6267

6368
const changedFiles = getChangedTypescriptFiles().filter(

0 commit comments

Comments
 (0)