Skip to content

chore: Set allowUnreachableCode: false#17825

Merged
JLHwung merged 3 commits intobabel:mainfrom
liuxingbaoyu:unreachable
Mar 2, 2026
Merged

chore: Set allowUnreachableCode: false#17825
JLHwung merged 3 commits intobabel:mainfrom
liuxingbaoyu:unreachable

Conversation

@liuxingbaoyu
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

typescript-eslint has disabled incompatible ESLint rules.
no-unreachable is also included, so we enable allowUnreachableCode: false in TypeScript, which is faster and more accurate.

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Feb 24, 2026

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

"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/unbound-method": "off",
"prefer-rest-params": "off",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not disabled by ts-eslint.
Do you prefer to enable or disable it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an opinion here. We can probably enable it except helper codes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it, and it even complained that the parameter had already been used.
Let's disable it.

  const newFn = function (this: unknown, path: NodePath) {
    if (validator.call(path)) {
      return fn.apply(this, arguments);
    }
  };

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 25, 2026

Open in StackBlitz

commit: 993d0c2

@JLHwung JLHwung added the PR: Internal (next major) 🏠 A type of pull request used for our changelog categories for next major release label Mar 2, 2026
@JLHwung JLHwung merged commit dd820f9 into babel:main Mar 2, 2026
55 checks passed
@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Mar 7, 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 PR: Internal (next major) 🏠 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants