Repository navigation
Conversation
…k body
The `always` fix unwrapped the body with `get_inner_expression`, which also strips
TS wrappers, so `() => <T>{ a }` and `() => ({ a }) as T` became `() => {return { a }}`.
Only drop the parentheses around the leading object literal and keep the rest of the
expression, matching ESLint.
camc314
enabled auto-merge (squash)
October 19, 2026 22:28
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
This was referenced Oct 26, 2026
Dunqing
added a commit
that referenced
this pull request
Oct 27, 2026
# Oxlint ### 🚀 Features - cf34678 oxlint: Export `Oxlintrc` type (#28132) (Sysix) - 831cdf1 oxlint: Require mininum oxlint-tsgolint version v7.0.2005 (#28118) (camc314) - d1b00f4 linter/typescript: Implement no-unsafe-enum-assignment rule (#28117) (camc314) - 165c91f linter/typescript/await-thenable: Support `allowMixedPromiseArrays` option (#28116) (camc314) ### 🐛 Bug Fixes - 7f3c908 linter/eslint/array-callback-return: Check callbacks passed with extra arguments (#28133) (sarankumar) - 53be530 linter: Filter by type aware rules when looking up tsgolint rule severity (#28138) (NavpreetSSidhu) - e0f8937 react-compiler: Compile a `try` whose `catch` is unreachable instead of panicking (#28066) (Dunqing) - f5b625f linter/eslint/no-useless-concat: See through parenthesized expressions (#27984) (Rahul Kashyap) - 4629bb2 linter/jest/no-conditional-expect: Check function expression callbacks (#28055) (camc314) - 5c84098 semantic,linter: Report names with lone surrogates in enum and lint checks (#27991) (Dunqing) - f3705a9 linter/eslint/prefer-const: Skip fixers if any declarator is reassigned (#28008) (Prince Jain) - 4c0fa90 minifier,linter: Keep `delete` of constant members and later JSX keys (#27990) (Dunqing) - 0298062 linter/arrow-body-style: Keep type assertions when adding a block body (#27978) (Yan Almeida) # Oxfmt ### 🐛 Bug Fixes - 5042019 formatter: Keep fill layout for array with comment after [ (#28170) (leaysgur) - 9d37ff6 formatter: Use position-based comment checks for concise arrays (#28169) (leaysgur) - 016c4a2 formatter: Keep a comment before `}` inside a JSX spread child (#28103) (vidigoat) - 190bb1e formatter: Keep parens around an instantiation expression ending an operand through any tight parent (#28168) (leaysgur) - a5314a1 formatter: Keep `;` before `in` and `instanceof` class members (#28166) (leaysgur) - 3a56e7c formatter: Keep closing HTML comments at the start of a line (#28064) (Cameron) - 23d23d6 formatter_markdown: Honor range ignore inside directives (#28164) (leaysgur) - 5f1fd3d formatter: Measure width heuristics by display width (#28098) (leaysgur) - a5a52cf formatter: Keep parens around private `in` expressions (#28096) (leaysgur) - 999496e formatter: Measure a short key by its display width (#28026) (vidigoat) - 7e9aa44 formatter: Keep parens around a looser operand of an instantiation expression (#28025) (vidigoat) - 6912d1f formatter: Keep an arrow signature that exactly fills the line for any body (#27989) (leaysgur) - eb1d9f9 formatter_core: Count a flat `line` space in `fits` only when text follows (#27987) (leaysgur) ### ⚡ Performance - 1ed93af data_structures: Copy short strings without a memcpy call (#27953) (leaysgur) - 7948f0b formatter_core: Shrink `FormatElement` to 16B (#28012) (leaysgur) - 788af22 formatter: Keep `AstNode`s on the stack, and only chain links in the arena (#27963) (leaysgur) ### 📚 Documentation - 068a8ea formatter: Fix up wording (#28167) (leaysgur) - db55461 formatter_core: Document text width divergence (#28095) (leaysgur) - 880d229 formatter: Add vitest-test-call to known divergences (#28006) (leaysgur) Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
53 of 95 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27977
With
arrow-body-style: ["error", "always"], the fix unwrapped the concise body withget_inner_expression, which strips TS wrappers together with the parentheses, so the type assertion was lost. Now only the parentheses around the leading object literal are removed (the same tokens ESLint removes) and the rest of the expression is kept.() => <T>{ id }() => {return { id }}() => {return <T>{ id }}() => <T>({ id })() => {return { id }}() => {return <T>({ id })}() => ({ id }) as T() => {return { id }}() => {return { id } as T}() => ({ id }) satisfies T() => {return { id }}() => {return { id } satisfies T}Plain
() => ({ id })still becomes() => {return { id }}.Tests: added a
.tstest (test_typescript) with pass/fail/fix cases (also({ id })!,(({ id }) as T)andrequireReturnForObjectLiteral) and its snapshot.cargo test --all-features -p oxc_linterandjust lint -p oxc_linterpass.AI disclosure: this PR was prepared with the help of an AI assistant (Claude).