Skip to content

Add babel/no-empty eslint rule - #18009

Open
JLHwung wants to merge 9 commits into
babel:mainfrom
JLHwung:add-babel-no-empty-eslint-rule
Open

JLHwung wants to merge 9 commits into
babel:mainfrom
JLHwung:add-babel-no-empty-eslint-rule

Conversation

@JLHwung

@JLHwung JLHwung commented May 21, 2026 •

Copy link
Copy Markdown
Contributor
Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3227
Any Dependency Changes?
License MIT

This PR is based on #17956.

In this PR we add a new @babel/no-empty rule to replace the builtin ESLint rule. The new rule allows empty block of the do expression as do{} is shorter than void 0 and async do{} is shorter than Promise.resolve(void 0).

We also add @babel/no-empty to the recommended preset as no-empty is in the recommended preset of @eslint/js.

@JLHwung JLHwung added PR: New Feature 馃殌 A type of pull request used for our changelog categories area: eslint labels May 21, 2026
@babel-bot

babel-bot commented May 21, 2026 •

Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new

pkg-pr-new Bot commented May 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

commit: 44cd45a

@JLHwung JLHwung changed the title Add @babel/no-empty eslint rule Add babel/no-empty eslint rule May 21, 2026
@JLHwung
JLHwung force-pushed the add-babel-no-empty-eslint-rule branch from 0fb5fbf to 16ff9cd Compare July 15, 2026 18:13
@nicolo-ribaudo nicolo-ribaudo added this to the v8.1.0 milestone Jul 16, 2026
@nicolo-ribaudo nicolo-ribaudo added the PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release label Jul 16, 2026
@JLHwung

JLHwung commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

The Docs PR is ready: babel/website#3227, ptal.

@JLHwung
JLHwung force-pushed the add-babel-no-empty-eslint-rule branch from 16ff9cd to 5e4f3c5 Compare July 17, 2026 18:14
@JLHwung
JLHwung force-pushed the add-babel-no-empty-eslint-rule branch from 5e4f3c5 to 73c199a Compare July 17, 2026 18:58
@JLHwung

JLHwung commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

New integration test cases show how babelPlugin.configs.recommended should be used with the builtin JS config and how one can override the predefined configurations.

@JLHwung
JLHwung force-pushed the add-babel-no-empty-eslint-rule branch from b9c8cd8 to 44cd45a Compare July 17, 2026 21:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: eslint PR: New Feature 馃殌 A type of pull request used for our changelog categories PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants