Skip to content

chore: enable some ts-eslint rules - #17592

Merged
JLHwung merged 7 commits into
babel:mainfrom
JLHwung:ts-eslint-rules
Nov 24, 2025
Merged

JLHwung merged 7 commits into
babel:mainfrom
JLHwung:ts-eslint-rules

Conversation

@JLHwung

@JLHwung JLHwung commented Nov 17, 2025

Copy link
Copy Markdown
Contributor
Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues? babel-standalone throws "Invalid plugin specified in Babel options: foo, [Object object]" when provided an invalid plugin with options.
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

In this PR we enabled a few previously disabled ts-eslint rules.

  • array-type
  • consistent-generic-constructors
  • consistent-indexed-object-style
  • no-base-to-string
  • no-unsafe-declaration-merging

The no-base-to-string rule detects a potential bug in the babel-standalone error message handling. This bug is also fixed in this PR.

The following rules have been deprecated and replaced by third-party ts-eslint plugins. Before we install other plugins, they can be safely removed from our config:

  • ban-types
  • sort-type-constituents

@JLHwung JLHwung added PR: Polish 馃拝 A type of pull request used for our changelog categories pkg: standalone labels Nov 17, 2025
@babel-bot

babel-bot commented Nov 17, 2025 •

Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

commit: 68056df

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would have slightly preferred the last commit to be in a separate PR.

The ban-types rule has been removed in ts-eslint v8.
This rule has been deprecated in favor of the perfectionist/sort-intersection-types and perfectionist/sort-union-types rules. Since we have installed perfectionist, removing this rule becomes no-op.
@JLHwung JLHwung removed PR: Polish 馃拝 A type of pull request used for our changelog categories pkg: standalone labels Nov 24, 2025
@JLHwung JLHwung changed the title Polish(standalone): improve message on invalid preset/plugin chore: enable some ts-eslint rules Nov 24, 2025
@JLHwung

JLHwung commented Nov 24, 2025

Copy link
Copy Markdown
Contributor Author

I would have slightly preferred the last commit to be in a separate PR.

OK, the last two commits are moved to #17606

@JLHwung
JLHwung merged commit 99dcba5 into babel:main Nov 24, 2025
74 checks passed
@JLHwung
JLHwung deleted the ts-eslint-rules branch November 24, 2025 20:56
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 24, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants