Skip to content

Commit 753bedf

Browse files
Remove unused internal exports (#18235)
1 parent dc9f9cf commit 753bedf

37 files changed

Lines changed: 418 additions & 592 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"jest-light-runner": "^0.7.12",
7171
"jest-worker": "^30.4.1",
7272
"json5": "^2.2.3",
73-
"knip": "^6.14.2",
73+
"knip": "^6.35.1",
7474
"lint-staged": "^17.0.0",
7575
"mergeiterator": "^1.4.4",
7676
"open": "^11.0.0",

‎packages/babel-code-frame/src/common.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ export interface Options {
3838
* RegExp to test for newlines in terminal.
3939
*/
4040

41-
export const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
41+
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
4242

4343
/**
4444
* Extract what lines should be marked and highlighted.
4545
*/
4646

4747
type MarkerLines = Record<number, true | [number, number]>;
4848

49-
export function getMarkerLines(
49+
function getMarkerLines(
5050
loc: NodeLocation,
5151
source: string[],
5252
opts: Options,

‎packages/babel-core/src/config/cache-contexts.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import type {
44
TargetsListOrObject,
55
} from "./validation/options.ts";
66

7-
export type { ConfigContext as FullConfig };
8-
97
export type FullPreset = {
108
targets: TargetsListOrObject;
119
} & ConfigContext;

‎packages/babel-core/src/config/caching.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type SimpleCacheConfigurator = {
2121
invalidate: <T extends SimpleType>(handler: () => T) => T;
2222
};
2323

24-
export type CacheEntry<ResultT, SideChannel> = {
24+
type CacheEntry<ResultT, SideChannel> = {
2525
value: ResultT;
2626
valid: (channel: SideChannel) => Handler<boolean>;
2727
}[];

‎packages/babel-core/src/config/config-chain.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function* buildPresetChain(
8686
};
8787
}
8888

89-
export const buildPresetChainWalker = makeChainWalker<PresetInstance>({
89+
const buildPresetChainWalker = makeChainWalker<PresetInstance>({
9090
root: preset => loadPresetDescriptors(preset),
9191
env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
9292
overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),

‎packages/babel-core/src/config/full.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ export type ResolvedConfig = {
5353
};
5454

5555
export type { Plugin };
56-
export type PluginPassList = Plugin[];
57-
export type PluginPasses = PluginPassList[];
56+
export type PluginPasses = Plugin[][];
5857

5958
export default gensync(function* loadFullConfig(
6059
inputOpts: InputOptions | null | undefined,

‎packages/babel-core/src/config/validation/options.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ type Assumptions = {
150150

151151
export type AssumptionName = keyof Assumptions;
152152

153+
type EnvSet<T> = Record<string, T>;
154+
153155
export type InputOptions = {
154156
cwd?: string;
155157
filename?: string;
@@ -257,7 +259,6 @@ export type CallerMetadata = {
257259
supportsTopLevelAwait?: boolean;
258260
supportsExportNamespaceFrom?: boolean;
259261
};
260-
export type EnvSet<T> = Record<string, T>;
261262
export type MatchItem =
262263
| string
263264
| RegExp
@@ -270,7 +271,7 @@ export type MatchItem =
270271
},
271272
) => unknown);
272273

273-
export type MaybeDefaultProperty<T> = T | { default: T };
274+
type MaybeDefaultProperty<T> = T | { default: T };
274275

275276
export type PluginTarget<Option = object> =
276277
| string

‎packages/babel-generator/src/printer.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,13 @@ export type Format = {
110110
topicToken?: GeneratorOptions["topicToken"];
111111
};
112112

113-
interface PrintSequenceOptions {
114-
statement?: boolean;
115-
indent?: boolean;
116-
trailingCommentsLineOffset?: number;
117-
}
118-
119113
interface PrintListOptions {
120114
separator?: (this: Printer, occurrenceCount: number, last: boolean) => void;
121115
statement?: boolean;
122116
indent?: boolean;
123117
printTrailingSeparator?: boolean;
124118
}
125119

126-
export type PrintJoinOptions = PrintListOptions & PrintSequenceOptions;
127120
class Printer {
128121
constructor(
129122
format: Format,
@@ -943,7 +936,7 @@ class Printer {
943936
nodes: t.Node[] | undefined | null,
944937
statement?: boolean,
945938
indent?: boolean,
946-
separator?: PrintJoinOptions["separator"] | null,
939+
separator?: PrintListOptions["separator"] | null,
947940
printTrailingSeparator?: boolean | null,
948941
resetTokenContext?: boolean,
949942
trailingCommentsLineOffset?: number,

‎packages/babel-helper-create-class-features-plugin/src/decorators.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export function hasOwnDecorators(node: t.Class | t.ClassBody["body"][number]) {
1414
return !!node.decorators?.length;
1515
}
1616

17-
export function hasDecorators(node: t.Class) {
18-
return hasOwnDecorators(node) || node.body.body.some(hasOwnDecorators);
19-
}
20-
2117
import * as charCodes from "charcodes";
2218

2319
type ClassDecoratableElement =

‎packages/babel-helper-create-class-features-plugin/src/fields.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,12 +1202,12 @@ function replaceThisContext(
12021202
return state.needsClassRef;
12031203
}
12041204

1205-
export type PropNode =
1205+
export type PropPath = NodePath<
12061206
| t.ClassProperty
12071207
| t.ClassPrivateMethod
12081208
| t.ClassPrivateProperty
1209-
| t.StaticBlock;
1210-
export type PropPath = NodePath<PropNode>;
1209+
| t.StaticBlock
1210+
>;
12111211

12121212
function isNameOrLength({ key, computed }: t.ClassProperty) {
12131213
if (key.type === "Identifier") {

0 commit comments

Comments
 (0)