Skip to content

Remove unused internal exports - #18235

Open
nicolo-ribaudo wants to merge 7 commits into
babel:mainfrom
nicolo-ribaudo:knip
Open

Remove unused internal exports#18235
nicolo-ribaudo wants to merge 7 commits into
babel:mainfrom
nicolo-ribaudo:knip

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Sep 11, 2026

Copy link
Copy Markdown
Member
Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

knip complains about a few more:

Unused exported types (6)
tsParseEntityNameFlags                  enum       鈥-parser/src/plugins/typescript/index.ts:318:19
EstreeAccessorProperty               N  interface  packages/babel-parser/src/types.ts:292:18
EstreeTSEmptyBodyFunctionExpression  N  interface  packages/babel-parser/src/types.ts:333:18
EstreeTSAbstractPropertyDefinition   N  interface  packages/babel-parser/src/types.ts:344:18
EstreeTSAbstractAccessorProperty     N  interface  packages/babel-parser/src/types.ts:349:18
NodePath_Internal                       type       packages/babel-traverse/src/path/index.ts:423:54

However, removing those makes TypeScript complain with errors like

packages/babel-parser/src/plugin-utils.ts:146:14 - error TS4023: Exported variable 'mixinPlugins' has or is using name 'tsParseEntityNameFlags' from external module "/Users/nic/Documents/dev/github.com/babel/babel/packages/babel-parser/src/plugins/typescript/index" but cannot be named.

This PR is probably easier to review commit-by-commit.

@nicolo-ribaudo nicolo-ribaudo changed the title Update knip Avoid exporting internal unused types Sep 11, 2026
@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 馃彔 A type of pull request used for our changelog categories label Sep 11, 2026
@babel-bot

babel-bot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62114

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: d974de4

@nicolo-ribaudo nicolo-ribaudo changed the title Avoid exporting internal unused types Remove unused internal exports Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Internal 馃彔 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants