Sitelet https://github.com/formatjs/formatjs/pull/7498
Skip to content

feat(eslint-plugin-formatjs): autofix prefer-formatted-message - #7498

Merged
longlho merged 2 commits into
mainfrom
codex/prefer-formatted-message-autofix
Sep 24, 2026
Merged

longlho merged 2 commits into
mainfrom
codex/prefer-formatted-message-autofix

Conversation

@longlho

@longlho longlho commented Sep 24, 2026

Copy link
Copy Markdown
Member

The rule reports imperative formatter calls in JSX but leaves every conversion manual.

Add autofix for direct JSX children from React Intl useIntl() bindings, including destructured aliases. Preserve descriptor/value expressions, reuse component imports, and merge collision-safe aliases into existing imports. Also check fragment children.

Keep unverified formatter bindings, optional calls, options, type arguments, comments, and unsafe descriptors report-only. Retain hook calls to preserve hook ordering. Document these boundaries and cover import safety and ESLint multipass convergence.

@longlho
longlho marked this pull request as ready for review September 24, 2026 12:46
@longlho
longlho enabled auto-merge (squash) September 24, 2026 12:49
@longlho
longlho merged commit 5ccbc3a into main Sep 24, 2026
20 checks passed
@longlho
longlho deleted the codex/prefer-formatted-message-autofix branch September 24, 2026 12:55
longlho pushed a commit that referenced this pull request Sep 24, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>formatjs_cli: 1.7.5</summary>

##
[1.7.5](formatjs_cli_v1.7.4...formatjs_cli_v1.7.5)
(2026-09-24)


### Bug Fixes

* **@formatjs/cli:** prevent partial catalogs after read failures
([#7497](#7497))
([a88ac15](a88ac15))
* **deps:** update oxc to 0.150
([#7483](#7483))
([25ba670](25ba670))
* **deps:** update ruff to v0.16.8
([#7502](#7502))
([0a41614](0a41614))
</details>

<details><summary>@formatjs/cli: 6.16.32</summary>

##
[6.16.32](https://github.com/formatjs/formatjs/compare/@formatjs/cli@6.16.31...@formatjs/cli@6.16.32)
(2026-09-24)


### Dependencies

* The following workspace dependencies were updated
  * optionalDependencies
    * @formatjs/cli-native-darwin-arm64 bumped to 1.1.26
    * @formatjs/cli-native-linux-arm64 bumped to 1.2.26
    * @formatjs/cli-native-linux-arm64-musl bumped to 1.0.24
    * @formatjs/cli-native-linux-x64 bumped to 1.1.26
    * @formatjs/cli-native-linux-x64-musl bumped to 1.0.24
    * @formatjs/cli-native-win32-x64 bumped to 1.1.27
</details>

<details><summary>@formatjs/cli-lib: 10.0.8</summary>

##
[10.0.8](https://github.com/formatjs/formatjs/compare/@formatjs/cli-lib@10.0.7...@formatjs/cli-lib@10.0.8)
(2026-09-24)


### Bug Fixes

* **@formatjs/cli:** prevent partial catalogs after read failures
([#7497](#7497))
([a88ac15](a88ac15))


### Dependencies

* The following workspace dependencies were updated
  * optionalDependencies
    * @formatjs/cli-native-darwin-arm64 bumped to 1.1.26
    * @formatjs/cli-native-linux-arm64 bumped to 1.2.26
    * @formatjs/cli-native-linux-arm64-musl bumped to 1.0.24
    * @formatjs/cli-native-linux-x64 bumped to 1.1.26
    * @formatjs/cli-native-linux-x64-musl bumped to 1.0.24
    * @formatjs/cli-native-win32-x64 bumped to 1.1.27
</details>

<details><summary>@formatjs/cli-native-darwin-arm64: 1.1.26</summary>

##
[1.1.26](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-darwin-arm64@1.1.25...@formatjs/cli-native-darwin-arm64@1.1.26)
(2026-09-24)
</details>

<details><summary>@formatjs/cli-native-linux-arm64: 1.2.26</summary>

##
[1.2.26](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-linux-arm64@1.2.25...@formatjs/cli-native-linux-arm64@1.2.26)
(2026-09-24)
</details>

<details><summary>@formatjs/cli-native-linux-arm64-musl:
1.0.24</summary>

##
[1.0.24](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-linux-arm64-musl@1.0.23...@formatjs/cli-native-linux-arm64-musl@1.0.24)
(2026-09-24)
</details>

<details><summary>@formatjs/cli-native-linux-x64: 1.1.26</summary>

##
[1.1.26](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-linux-x64@1.1.25...@formatjs/cli-native-linux-x64@1.1.26)
(2026-09-24)
</details>

<details><summary>@formatjs/cli-native-linux-x64-musl: 1.0.24</summary>

##
[1.0.24](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-linux-x64-musl@1.0.23...@formatjs/cli-native-linux-x64-musl@1.0.24)
(2026-09-24)
</details>

<details><summary>@formatjs/cli-native-win32-x64: 1.1.27</summary>

##
[1.1.27](https://github.com/formatjs/formatjs/compare/@formatjs/cli-native-win32-x64@1.1.26...@formatjs/cli-native-win32-x64@1.1.27)
(2026-09-24)
</details>

<details><summary>@formatjs/intl-locale: 5.3.12</summary>

##
[5.3.12](https://github.com/formatjs/formatjs/compare/@formatjs/intl-locale@5.3.11...@formatjs/intl-locale@5.3.12)
(2026-09-24)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @formatjs/intl-supportedvaluesof bumped to 2.3.11
</details>

<details><summary>@formatjs/intl-supportedvaluesof: 2.3.11</summary>

##
[2.3.11](https://github.com/formatjs/formatjs/compare/@formatjs/intl-supportedvaluesof@2.3.10...@formatjs/intl-supportedvaluesof@2.3.11)
(2026-09-24)


### Bug Fixes

* **deps:** update oxc to 0.150
([#7483](#7483))
([25ba670](25ba670))
</details>

<details><summary>eslint-plugin-formatjs: 8.1.0</summary>

##
[8.1.0](https://github.com/formatjs/formatjs/compare/eslint-plugin-formatjs@8.0.5...eslint-plugin-formatjs@8.1.0)
(2026-09-24)


### Features

* **eslint-plugin-formatjs:** autofix prefer-formatted-message
([#7498](#7498))
([5ccbc3a](5ccbc3a))
</details>

<details><summary>react-intl: 12.1.3</summary>

##
[12.1.3](https://github.com/formatjs/formatjs/compare/react-intl@12.1.2...react-intl@12.1.3)
(2026-09-24)


### Bug Fixes

* **deps:** update dependency @formatjs/icu-messageformat-parser to
v3.5.19 ([#7496](#7496))
([9cdcee7](9cdcee7))
* **deps:** update formatjs monorepo
([#7468](#7468))
([de413f4](de413f4))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant