Remove unused internal exports by nicolo-ribaudo · Pull Request #18235 · babel/babel · GitHub
Skip to content

Remove unused internal exports - #18235

Merged
nicolo-ribaudo merged 7 commits into
babel:mainfrom
nicolo-ribaudo:knip
Sep 17, 2026
Merged

nicolo-ribaudo merged 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       …l-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
@nicolo-ribaudo

Copy link
Copy Markdown
Member Author

@nicolo-ribaudo
nicolo-ribaudo merged commit 753bedf into babel:main Sep 17, 2026
58 checks passed
@nicolo-ribaudo
nicolo-ribaudo deleted the knip branch September 17, 2026 14:26
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.

3 participants