Skip to content

Add babel/no-empty eslint rule#18009

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

Add babel/no-empty eslint rule#18009
JLHwung wants to merge 7 commits into
babel:mainfrom
JLHwung:add-babel-no-empty-eslint-rule

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented May 21, 2026

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
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
Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

Open in StackBlitz

commit: 0fb5fbf

@JLHwung JLHwung changed the title Add @babel/no-empty eslint rule Add babel/no-empty eslint rule May 21, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants