leaysgur
a7f02a320c
refactor(formatter): share the gap-segment walk and cursor helpers in Comments ( #26433 )
...
Pure refactoring;
2026-09-08 06:02:03 +00:00
leaysgur
44694ddc43
refactor(formatter): group Comments methods by cursor-based, position-based, and state ( #26432 )
...
Just reordering `impl` methods, and also update comments.
2026-09-08 06:02:02 +00:00
leaysgur
70918a3448
refactor(formatter): make is_cast_target position-based ( #26431 )
...
We use `preserve_parens: false`, need to detect typecast `()` from source, always.
2026-09-08 06:02:02 +00:00
leaysgur
b26bf56cd5
refactor(formatter): route every assignment RHS shape rule through a cast-aware accessor ( #26430 )
...
Follow up on #26429 , apply cast-aware behavior to assignment call sites.
2026-09-08 06:02:01 +00:00
leaysgur
33cdc841ac
fix(formatter): keep cast-target assignment and commented parameter patterns ( #26429 )
...
Fixes #26425 , #26426 .
- Exclude cast target from never-break check
- Use position based comment check
2026-09-08 06:02:01 +00:00
oxc-guard
b4da00b621
release(apps): oxlint v1.82.0 && oxfmt v0.67.0 ( #26384 )
...
# Oxlint
### 🚀 Features
- 6a0e19c linter/eslint/no-unmodified-loop-condition: Support `checkConditionalExpressions` option (#26249 ) (camc314)
### 🐛 Bug Fixes
- 562dd14 jsx-a11y/anchor-has-content: Allow anchors passed as custom component props (#26360 ) (Mikhail Baev)
- 253cdb2 linter/eslint/id-length: Exempt TS interface/type-literal members with never (#26310 ) (Pearce Ropion)
- 8c7ea76 ast_visit: Account for trimmed source offsets (#26223 ) (Cameron)
- 5f9cffc linter/typescript/no-explicit-any: Fix rest parameter to `unknown[]` (#26279 ) (camc314)
- 4de9fa3 linter/react/jsx-no-literals: Check nested JSX expression literals (#26253 ) (camc314)
- 07851b9 parser: Fix debug assert failure when lexer error with tokens enabled (#26229 ) (overlookmotel)
- 9cee146 oxlint/lsp: Don't try to parse fix message, always fallback (#26204 ) (Sysix)
- a662c40 linter/eslint/no-useless-assignment: Handle destructuring assignments (#25925 ) (camc314)
- 304bd9a linter/eslint/no-array-constructor: Handle ASI hazards in fixer (#26166 ) (Hamody We)
- b41bb35 linter: Qualify rules in rules output (#26250 ) (camc314)
- 895c685 linter/typescript/no-extraneous-class: Avoid deleting class expressions (#26231 ) (camc314)
- 4ba33c8 linter/eslint/no-unused-vars: Handle stored arrow references (#26225 ) (camc314)
### 🛡️ Security
- 9a612d5 deps: Update npm packages (#26178 ) (renovate[bot])
# Oxfmt
### 💥 BREAKING CHANGES
- 2c9a947 parser: [**BREAKING**] Reduce `MAX_LEN` to 256 bytes below `u32::MAX` (#26352 ) (overlookmotel)
### 🚀 Features
- 68e12ab formatter_css: Follow the oxc-css-parser's acceptance line (#26337 ) (leaysgur)
### 🐛 Bug Fixes
- f7acdc0 formatter: Treat a JSDoc cast target as opaque in chain layouts (#26375 ) (leaysgur)
- 104061b formatter: Keep JSDoc cast parens with a comment inside them (#26374 ) (leaysgur)
- 3d00a76 formatter_css: Keep comment inside important and simple-vars colon (#26370 ) (leaysgur)
- 172ddb6 formatter_css: Keep a same-line line comment on its line (#26321 ) (leaysgur)
- cafaf32 formatter_css: Never drop comments inside an at-rule prelude (#26320 ) (leaysgur)
- 534a0fe formatter_css: Keep a line comment on its comma's line (#26319 ) (leaysgur)
- 99cfd75 formatter_css: Hide raw comment printing API, use strcut instead (#26316 ) (leaysgur)
- 2028896 formatter_css: Preserve comments around SCSS/Less variable values (#26276 ) (leaysgur)
- 6752abc formatter_css: Keep leading comments before (#26272 ) (leaysgur)
- 3b054de formatter_graphql: Align comment printing after open `{` (#26271 ) (leaysgur)
- b3c287a formatter_css: Fix SCSS bracket list printing (#26270 ) (leaysgur)
- bac770a formatter_css: Preserve comment in SCSS paren comma list (#26269 ) (leaysgur)
- c7b57ef formatter_css: Print SCSS map consisntent with and without comment (#26268 ) (leaysgur)
- 063e2b6 formatter_css: Preserve trailing comma in single-item scss lists (#26245 ) (leaysgur)
- 5f9580d oxfmt: Bump prettier-plugin-tailwindcss (#26273 ) (leaysgur)
### ⚡ Performance
- 1cad286 oxfmt: Match editorconfig once per file (#26239 ) (Yuji Sugiura)
- 260c5eb oxfmt: Match `overrides` once per file (#26238 ) (leaysgur)
- 61565bc oxfmt: Share resolved `FormatConfig` via `Arc` instead of cloning per file (#26237 ) (leaysgur)
### 📚 Documentation
- 32084d4 formatter_core: Clarify printer hard_line compression (#26312 ) (leaysgur)
- 4fabdcc formatter,formatter_css,formatter_graphql,formatter_yaml: Update DIVERGENCES.md (#26267 ) (leaysgur)
- 26a1fa4 formatter_core: Refine FORMATTER_POLICY (#26266 ) (leaysgur)
### 🛡️ Security
- 9a612d5 deps: Update npm packages (#26178 ) (renovate[bot])
2026-09-07 14:13:57 +00:00
overlookmotel
66744f0eb9
feat(parser)!: rename panicked to fatal_error in ParserReturn ( #26382 )
...
`ParserReturn` contains a property `panicked`.
The name `panicked` is misleading. The parser did _not_ panic. When `true`, it means that the parser encountered a fatal error and is unable to parse the source, because it contains an unrecoverable syntax error.
Rename this property to `fatal_error`, to better describe what it means.
This is a breaking change, but one that's trivial to fix in downstream code - the property doesn't change its meaning or behavior, just its name.
All the changes in this PR in other crates are just reacting to this change and making everywhere use the term "fatal error" instead of "panicked", so the codebase is consistent.
2026-09-07 09:41:52 +00:00
leaysgur
f7acdc0bd9
fix(formatter): treat a JSDoc cast target as opaque in chain layouts ( #26375 )
...
Fixes #20181
2026-09-07 04:56:37 +00:00
leaysgur
104061b98a
fix(formatter): keep JSDoc cast parens with a comment inside them ( #26374 )
...
Fixes #26274 , #26275 .
2026-09-07 04:56:37 +00:00
leaysgur
b3613b176a
test(oxfmt): use svelte repo for jsdoc conformance fixture ( #26371 )
...
Add `svelte` repo for JSDoc conformance.
2026-09-07 04:56:36 +00:00
leaysgur
0f4af5d7df
test(formatter_tests): assert fingerprint survives formatting ( #26322 )
...
Historically, only JS formatter has had the `detect_code_removal` feature, which uses CI to check for missing nodes or comments.
While this would be useful in other languages (especially CSS), but setting up the mechanism is difficult. For now, just start with something simple that just guarantees the number of comments.
That said, even with a mechanism in place, it can't detect anything unless the cases are fully covered by fixtures, so this only tells us that the current state is problem-free.
2026-09-04 07:14:53 +00:00
leaysgur
fa493a735e
refactor(formatter): remove impl Format for Comment for safety ( #26313 )
...
If line-comment is printed with this and forget to add `hardline` after it, content rides on line-comment and disappear.
To prevent, hide raw API and always use safer struct based one.
2026-09-04 07:14:50 +00:00
leaysgur
4fabdcca11
docs(formatter,formatter_css,formatter_graphql,formatter_yaml): update DIVERGENCES.md ( #26267 )
...
Update each document following #26266 policy.
2026-09-03 08:17:34 +00:00
oxc-guard
0b4e2e67f4
release(apps): oxlint v1.81.0 && oxfmt v0.66.0 ( #26199 )
...
# Oxlint
### 🚀 Features
- 60b945d linter/nextjs/no-typos: Implement suggestion (#26091 ) (Mikhail Baev)
### 🐛 Bug Fixes
- 33ac4b0 linter/lsp: Prevent tsgolint from holding onto processes (#25570 ) (Adrian Schaedle)
- baf4b1e linter/import/no-empty-named-blocks: Make empty value import removal a suggestion (#26155 ) (camc314)
- 77cfaec linter/eslint/object-shorthand: Preserve `__proto__` semantics (#26154 ) (camc314)
- fa3c082 linter/unicorn/prefer-set-size: Ignore shadowed `Set` constructors (#26153 ) (camc314)
- e412cf2 linter: Clamp invalid JS plugin locations (#26144 ) (camc314)
- d86c113 linter: Normalize reversed JS plugin locations (#26138 ) (camc314)
- 73c09b2 linter/eslint/no-use-before-define: Run on JS, JSX files (#26114 ) (camc314)
- 03ef0f2 linter/unicorn/no-useless-spread: Treat typed arrays as a distinct value hint (#26067 ) (Aadharsh Pannirselvam)
- bd15905 linter/react/no-unstable-nested-components: Check nested component object property names (#26101 ) (camc314)
- 3910e2b linter/eslint/no-unassigned-vars: Skip Svelte and Vue files (#26042 ) (Hamody We)
- 047f7ca linter/plugins: Fix interaction between JS plugins and Vue rules (#26080 ) (overlookmotel)
- 8531b9b linter/plugins: Alter method for obtaining mutable `Program` when sending AST to JS plugins (#26077 ) (overlookmotel)
- dc464ff linter/unicorn/prefer-math-min-max: Avoid unsafe autofix (#26060 ) (camc314)
### 📚 Documentation
- 464ddd1 linter: Support a shared short description for jest/vitest rules (#26186 ) (connorshea)
- 9db5ad3 linter: Add short description to `vue/no-dupe-keys` (#26183 ) (connorshea)
- db66f58 linter: Correct export/import mismatch in bar and foo example (#25927 ) (billychannnnnn)
- d5be037 linter/typescript/switch-exhaustiveness-check: Clarify default case comment pattern (#26100 ) (camc314)
# Oxfmt
### 🚀 Features
- 1fb37b6 formatter/css: Format declaration-shaped raw-prelude rules (postcss nested config blocks) (#26194 ) (leaysgur)
### 🐛 Bug Fixes
- 57e8e22 formatter_css: Space a folded sign after a call in Less operations (#26134 ) (leaysgur)
- e4298fb formatter/jsdoc: Follow CommonMark for interrupting lists and guard wrapping from creating them (#26098 ) (leaysgur)
- a1e21c2 formatter: Apply head body policy everywhere (#26074 ) (leaysgur)
- 676b7e1 formatter: Keep comments in their for-head slot, before an empty-statement body and do-while (#26073 ) (leaysgur)
- 3bbcea6 formatter: Keep comments between a head and its body out of the braces across all constructs (#26071 ) (leaysgur)
- 57537a2 formatter: Place comments between a head and open paren (#26058 ) (leaysgur)
- e2d53e7 formatter: Place comments between a statement head and its body (#26043 ) (leaysgur)
- 662556c formatter: Print the idempotent placement for comments in dropped parens (#26041 ) (leaysgur)
- faf11d9 formatter_yaml: Keep trailing whitespace in block scalars (#26072 ) (leaysgur)
### ⚡ Performance
- ac4785a diagnostics: Use fixed ANSI styles (#26130 ) (Boshen)
### 📚 Documentation
- b879608 formatter,formatter_graphql,formatter_yaml: Annotate own-line comment inlining as known policy violation (#26131 ) (leaysgur)
- 181953b oxfmt,formatter_core,formatter,formatter_yaml,formatter_css,formatter_graphql: Extract `DIVERGENCES.md` out from `AGENTS.md` (#26121 ) (leaysgur)
- a67cb9d formatter,formatter_core: Document comment moving policy (#26075 ) (leaysgur)
- fc175b0 formatter_core: Clarify idempotency test infra (#26069 ) (leaysgur)
2026-09-01 08:25:16 +00:00
leaysgur
9f81002229
fix(formatter): re-add suppressed statement terminators per options.semi ( #26220 )
...
```js
// input (semi: true)
// oxfmt-ignore
const a = x
// before
// oxfmt-ignore
const a = x
// after
// oxfmt-ignore
const a = x;
```
```js
// input (semi: false)
let a = 1;
// oxfmt-ignore
[b].sort();
// before
let a = 1
// oxfmt-ignore
[b].sort(); // <- ASI failure
// after
let a = 1
// oxfmt-ignore
;[b].sort() // <- OK
```
2026-09-01 07:25:43 +00:00
leaysgur
769ffd590d
fix(formatter): print suppressed typecast parens ( #26218 )
...
```js
// input
foo(
// oxfmt-ignore
/** @type {A} */ (x),
/** @type {B} */ (y),
);
// before
foo(
// oxfmt-ignore
/** @type {A} */ x, // <-
/** @type {B} */ (y),
);
// after
foo(
// oxfmt-ignore
/** @type {A} */ (x), // <-
/** @type {B} */ (y),
);
```
2026-09-01 07:25:42 +00:00
leaysgur
5ff57f83c0
fix(formatter/sort-imports): handle custom side effect groups ( #26217 )
...
Fixes #26165
- `side_effect` is predefined selector, it cannot be used as custom group name
- respect custom group which uses `side_effect` as side-effect-import correctly
- fix metadata detection bug
2026-09-01 03:56:36 +00:00
leaysgur
2f4d759717
fix(formatter): do not skip cast comment lookup ( #26216 )
...
Fixes #26202
---
The trigger for this issue is the presence of a suppressed typecast.
```js
// oxfmt-ignore
const cast = /** c */ (x)
```
Because a comment had already been printed in a subsequent typecast check without going through the casting mechanism, it failed to find its own cast comment.
2026-09-01 03:56:35 +00:00
leaysgur
1213e12c0e
fix(formatter): preserve comment for statement terminators and binary casts ( #26213 )
...
Refine comment position preserving rules, for statements and binary casts. Fixes idempotency issues for several sites.
---
Trailing is the same-line run only.
A newline-preceded comment is never trailing. It defers to the next node's leading pass, staying own-line with its blank lines.
Comments around `as`/`satisfies` keep their source side and line-start side, within the grammar-defined slots (line terminator is not allowed between `as` and before).
2026-09-01 03:56:35 +00:00
leaysgur
b8796080d5
docs(formatter,formatter_graphql,formatter_yaml): annotate own-line comment inlining as known policy violation ( #26131 )
2026-08-27 06:29:50 +00:00
leaysgur
f94b22296c
test(formatter,formatter_css,formatter_json,formatter_yaml): restore coverage lost in fixture consolidation ( #26129 )
...
- Restore wrongly consolidated fixtures
- State new fixtures policy and apply
- Check `endOfLine` option and output at test harness level
2026-08-27 06:12:52 +00:00
leaysgur
2dba883bf2
test(formatter): consolidate redundant JS fixtures ( #26126 )
...
Consolidate redundant fixtures.
2026-08-27 05:34:00 +00:00
leaysgur
2d57487a30
test(formatter): consolidate redundant TS fixtures ( #26125 )
...
Consolidate redundant fixtures.
2026-08-27 05:34:00 +00:00
leaysgur
181953b92d
docs(oxfmt,formatter_core,formatter,formatter_yaml,formatter_css,formatter_graphql): extract DIVERGENCES.md out from AGENTS.md ( #26121 )
...
- Extract "known divergences" section from `AGENTS.md` to explicit `DIVERGENCES.md` with code example
- Update all anchors
- Add missing pinned fixtures
2026-08-27 05:33:58 +00:00
leaysgur
e4298fb23a
fix(formatter/jsdoc): follow CommonMark for interrupting lists and guard wrapping from creating them ( #26098 )
...
Fixes #25825 , #26026 .
---
If the formatter adjusts the wrapping and causes list-like characters to appear at the beginning of a line, those characters will be mistakenly converted into a list in the next formatting step.
Therefore, it is necessary to guard meaningful characters so that they do not appear at the beginning of a line.
Also, fixed an issue where character that should have originally been interpreted as lists were not, aligning with the CommonMark behavior.
2026-08-26 07:11:32 +00:00
leaysgur
a67cb9d8ce
docs(formatter,formatter_core): document comment moving policy ( #26075 )
2026-08-25 09:28:13 +00:00
leaysgur
a1e21c2573
fix(formatter): apply head body policy everywhere ( #26074 )
...
Covered more cases like `label` / `case`.
2026-08-25 09:28:13 +00:00
leaysgur
676b7e19e5
fix(formatter): keep comments in their for-head slot, before an empty-statement body and do-while ( #26073 )
...
Keep comments inside `for (init; test; update)`.
2026-08-25 09:28:12 +00:00
leaysgur
3bbcea6d9c
fix(formatter): keep comments between a head and its body out of the braces across all constructs ( #26071 )
...
Fix inconsisntet and also non-idempotent formatting around:
```js
m3(tagName: string, rect: number[]): void // THIS should stay
{
// ...
}
```
2026-08-25 09:28:12 +00:00
leaysgur
57537a2223
fix(formatter): place comments between a head and open paren ( #26058 )
...
Fixes inconsistency and idempotency issue for control statements.
e.g.
```js
while (x // THIS should stay here
) {
// ...
}
```
2026-08-25 09:28:11 +00:00
leaysgur
e2d53e7f18
fix(formatter): place comments between a statement head and its body ( #26043 )
...
Closes #25832 and more idempotency issues.
2026-08-25 09:28:11 +00:00
leaysgur
662556c174
fix(formatter): print the idempotent placement for comments in dropped parens ( #26041 )
...
Fixes non-idempotent formatting with comment and dropped parens.
2026-08-25 09:28:11 +00:00
oxc-guard
97e99b8548
release(apps): oxlint v1.80.0 && oxfmt v0.65.0 ( #26045 )
...
# Oxlint
### 🚀 Features
- 70c3e35 linter/typescript/no-confusing-non-null-assertion: Implement suggestion (#26012 ) (Mikhail Baev)
### 🐛 Bug Fixes
- 8a353a7 linter/eslint/no-control-regex: Refine help message text (#25996 ) (Rahul Mishra)
- 8a9bdbd estree: Include decorators in `FormalParameterRest ` spans (#26021 ) (camc314)
- 8d94cd1 linter/eslint/no-useless-rename: Preserve type modifiers (#26020 ) (Cameron)
- 2cde1f6 rust: Address nightly deprecations (#25998 ) (Boshen)
- 51d36d7 linter/vue: Resolve `vue` imports via shared import helpers (#25903 ) (Connor Shea)
- 83a68d2 linter/react/no-react-children: Resolve `react` imports by symbol (#25901 ) (Connor Shea)
- 124e196 linter: Resolve globals by reference, not by name (#25905 ) (Connor Shea)
- a701bcc linter: Remove invalid React compiler doc links (#25900 ) (Boshen)
### 📚 Documentation
- 9b7e153 linter: Set `version` to 1.79.0 for rules shipped in 1.79.0 (#25902 ) (connorshea)
# Oxfmt
### 🐛 Bug Fixes
- bf37dd5 formatter: Preserve class decorators before export when the statement is suppressed (#26034 ) (leaysgur)
2026-08-24 11:33:15 +00:00
leaysgur
0fe2313d7a
refactor(formatter): replace fmt_with_options with a context handoff ( #26037 )
...
Remove `fmt_with_options` impl to justify what to be generated and not.
In the first place, for `Function` one was not used.
2026-08-24 06:31:20 +00:00
leaysgur
6419ba452b
refactor(formatter): make write_supressed as trait impl default ( #26036 )
...
Pure refactoring.
2026-08-24 06:31:19 +00:00
leaysgur
bf37dd5c43
fix(formatter): preserve class decorators before export when the statement is suppressed ( #26034 )
...
Fixes #25911
---
As syntax, these two forms are equivalent:
```ts
@deco export class X {}
export @deco class X {}
```
However, in the former, the decorators lie outside the span of both the `ExportDeclaration` and the `Class`, they are inside no node's span.
The formatter's suppression path prints the `ExportDeclaration`'s span verbatim, so the decorators were silently dropped.
The latter form is unaffected because the decorators fall inside the export node's span.
2026-08-24 06:31:19 +00:00
oxc-guard[bot]
0db127cc16
release(apps): oxlint v1.79.0 && oxfmt v0.64.0 ( #25866 )
...
# Oxlint
### 💥 BREAKING CHANGES
- 8c4552d linter: [**BREAKING**] Split react/react-compiler into
per-category rules (#25500 ) (Boshen)
### 🚀 Features
- 9b7394e linter/typescript/no-empty-object-type: Implement suggestion
(#25833 ) (Mikhail Baev)
### 🐛 Bug Fixes
- 345f981 react_compiler: Skip node_modules by default (#25859 ) (Boshen)
- 2f40afa linter/unicorn/no-array-callback-reference: Ignore effect
library imports (#25857 ) (Michaël Bitard)
- 7b565a0 linter: Align React Compiler rule categories (#25840 ) (Boshen)
- 228e8e0 linter: Resolve inactive React compiler rules (#25830 )
(Boshen)
- f8e4884 linter/eslint/no-useless-constructor: Allow parameter
properties (#25811 ) (camc314)
- e4b6993 linter: Report exhaustive effect dependencies (#25829 )
(Boshen)
- 742e25f linter/eslint/no-return-assign: Anchor diagnostic on return
stmt (#25803 ) (camc314)
- b831ca8 react-compiler: Improve derived state diagnostic (#25804 )
(Boshen)
- 5908c87 linter/jest/prefer-mock-return-shorthand: Preserve
implementations using this (#25802 ) (camc314)
- f6b2265 linter/eslint/no-redeclare: Run in ES modules, skipping only
the globals check (#25691 ) (Hamody We)
- ca9f553 linter/unicorn/prefer-default-parameters: Mark fixer as a
suggestion (#25801 ) (camc314)
- aa49d86 linter: Allow spread rule options in config types (#25675 )
(ch3rry)
- d5483f8 linter/typescript/no-useless-empty-export: Skip TS declaration
files (#25789 ) (Evyatar Daud)
- 57f2199 linter/typescript/no-useless-empty-export: Report after
imports (#25786 ) (camc314)
- 633bc19 linter/typescript/no-unnecessary-type-conversion: Mark fixer
as `suggestion` (#25787 ) (camc314)
- dea3339 linter/typescript/explicit-module-boundary-types: Anchor
diagnostics on arrows (#25779 ) (camc314)
- 5cd6f02 linter/eslint/array-callback-return: Anchor diagnostic on
callback (#25780 ) (camc314)
- ef8cebf linter/eslint/preserve-caught-error: Handle AggregateError
options (#25775 ) (camc314)
- c108d5c linter: Improve React Compiler diagnostics (#25742 ) (Boshen)
- c9ec55e react-compiler: Improve diagnostic spans (#25731 ) (Boshen)
- 1cbbcb7 linter/unicorn/prefer-string-replace-all: Apply fixes in one
pass (#25709 ) (Mikhail Baev)
- dec0a86 react-compiler: Standardize diagnostics (#25702 ) (Boshen)
- 5fd77f7 linter/react/display-name: Report curried HOC inner component
(#25662 ) (camc314)
- 4dbb80e linter/import/no-named-as-default: Report local export
conflicts (#25658 ) (camc314)
- e8a7214 linter/react/rules-of-hooks: Report hooks inside try blocks
(#25670 ) (camc314)
- 36f8451 linter/eslint/no-eval: Align indirect default with ESLint
(#25656 ) (camc314)
- d901d24 linter/react/exhaustive-deps: Handle destructured object
dependencies (#25669 ) (camc314)
- beb724d linter/eslint/no-unused-vars: Report bare underscore
parameters (#25663 ) (camc314)
- fa36f26 linter/react/no-this-in-sfc: Detect this in nested arrow
callbacks (#25653 ) (camc314)
- 44d1be3 linter/typescript/no-var-requires: Run rule on JavaScript
(#25664 ) (camc314)
- 4004c10 linter/eslint/no-irregular-whitespace: Check comments by
default (#25660 ) (camc314)
- 625401d linter/import/no-named-default: Flag type-only named defaults
(#25661 ) (camc314)
- 8eacb2d linter/typescript/no-non-null-asserted-optional-chain: Detect
assertions after continued optional chains (#25659 ) (camc314)
- d55b76c linter/react/no-direct-mutation-state: Detect computed state
mutations (#25654 ) (camc314)
- f92c651 linter/unicorn/no-abusive-eslint-disable: Use directive prefix
in diagnostic (#25657 ) (camc314)
- ee44996 linter/eslint/max-classes-per-file: Anchor diagnostic at
program start (#25652 ) (camc314)
- 403ec40 linter/eslint/no-multi-assign: Handle parenthesized declarator
initializers (#25651 ) (camc314)
- 6c9ba37 linter/jest/expect-expect: Detect assertions in nested
function declarations (#25650 ) (camc314)
- 285820e linter/no-large-snapshots: Precompile and document allowed
snapshot matchers (#25611 ) (Mikhail Baev)
- 1be1e20 linter/eslint/prefer-promise-reject-errors: Report on spread
arguments (#25648 ) (Mikhail Baev)
- a38f7b3 oxlint,oxfmt: Apply .gitignore only to walk targets, not
explicitly named files (#25531 ) (leaysgur)
- 509931b semantic: Classify global references per identifier (#25608 )
(camc314)
- 0c68b7f estree: Emit `decorators` on `FormalParameterRest` (#25582 )
(camc314)
- 1d22912 linter/plugins: Parse rule-less directive justifications
(#25559 ) (camc314)
- eaf80d8 linter/unicorn/prefer-node-protocol: Validate exact Node.js
built-in specifiers (#25558 ) (camc314)
- 57b94af linter/promise/no-multiple-resolved: Ignore unresolved globals
(#25530 ) (Tushar Singh)
- 80e64c2 linter/expect-expect: Validate assertion regex (#25504 )
(Mikhail Baev)
- 7830604 linter/react/exhaustive-deps: Treat binary expressions as a
stable dependency (#25508 ) (Hamody We)
- 4df5835 linter: Allow capitalized built-in calls (#25516 ) (Boshen)
- 9d49d27 react_compiler: Bail out instead of panicking on "Expected a
node for all scopes" (#25506 ) (Boshen)
- d43b562 linter/vitest/prefer-expect-assertions: Handle parameterized
Vitest assertion suggestions (#25476 ) (camc314)
### ⚡ Performance
- e8303d6 linter: Shrink rule serialization dispatch (#25818 ) (Boshen)
- c84ede3 estree_tokens: Share JS token update entry point (#25826 )
(Boshen)
- 35c8eb2 linter: Compute sort keys once with sort_by_cached_key
(#25821 ) (Boshen)
- f0121ed linter: Share config deserialization entry point (#25820 )
(Boshen)
- 2dacf7a oxlint: Reduce debug formatting code size (#25797 ) (Boshen)
- 9ed10b7 linter: Use unstable sorts for unique keys (#25778 ) (Boshen)
- 63ff8ef linter: Outline diagnostic construction (#25762 ) (Boshen)
- 2dd7446 diagnostics: Preallocate graphical output (#25721 ) (Boshen)
- 9c8abab diagnostics: Batch graphical reports (#25710 ) (Boshen)
- 8e9b95f linter: Use table for rule names (#25458 ) (Boshen)
# Oxfmt
### 🚀 Features
- c07fe7c oxfmt: Support `experimentalOperatorPosition` (#25643 )
(leaysgur)
- 2adb8fb formatter: Implement `operatorPosition` option (#25581 )
(leaysgur)
### 🐛 Bug Fixes
- 44231fb formatter: Fix comment and indent issues around unions
(#25665 ) (leaysgur)
- 2465e87 formatter: Keep comments in place when dropping
`EmptyStatement` (#25730 ) (leaysgur)
- 7e4f3b7 formatter: Print `JSDocUnknownType` (#25729 ) (leaysgur)
- 5238d9e formatter: Keep nested awaited-paren member chain grouped in
call arguments (#25646 ) (leaysgur)
- a38f7b3 oxlint,oxfmt: Apply .gitignore only to walk targets, not
explicitly named files (#25531 ) (leaysgur)
- 5c0a5ff formatter_css: Fill own-line block comments inside
space-separated values (#25578 ) (leaysgur)
- 53debfa formatter_css: Keep trailing comma and indent after
comment-preceded last map value (#25577 ) (leaysgur)
- 1a83a8d oxfmt: Mirror printer line suppression and restore
dedent-to-root (#25573 ) (leaysgur)
- 7f350d1 formatter: Keep unary comment and print only needed parens
(#25526 ) (leaysgur)
- f405789 formatter_yaml: Consistent chomped eos behavior (#25523 )
(leaysgur)
- a243311 formatter_yaml: Bump oxc-yaml-parser for contentless block
scalar (#25519 ) (leaysgur)
- 40d38a0 formatter_css: Keep multi value function args intact after
leading comment (#25518 ) (leaysgur)
### 📚 Documentation
- 223e785 oxfmt/conformance: Update notes on conformance (#25757 ) (Yuji
Sugiura)
- 673dc6d oxfmt: Move some docs from AGENTS.md to code comment (#25649 )
(leaysgur)
- fed6681 oxfmt: Skip expanding overrides options (#25572 ) (leaysgur)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2026-08-18 22:27:08 +08:00
leaysgur
44231fb5f7
fix(formatter): fix comment and indent issues around unions ( #25665 )
...
Fixes comment-placement bugs, idempotency and also inconsistency around unions/intersections, type aliases, conditional types, and assignment-likes.
- Fix invariant violations where comments crossed `=`, the value, or `;`
- removed the relocation logic emulating old Prettier 3.8 behavior
- Normalize a union's leading comments to one canonical form behind the synthesized leading `|`, independent of the source shape
- Comments around a formatter-added `(` keep their source side of the `(`
- Hug conditional-type branch comments behind `?`/`:` with the content one level under the operator, matching conditional expressions
- Extend `= // c` position preservation from type aliases to all of JS
2026-08-16 15:04:28 +00:00
leaysgur
2465e87905
fix(formatter): keep comments in place when dropping EmptyStatement ( #25730 )
...
Fixes #25705
---
JS formatter drops `;` (`EmptyStatement`) in a statement list.
However, this raises a question: how are the surrounding comments handled when it is dropped?
This happens because when the comment cursor retrieves that information from the `span`s of the preceding and following nodes, the `EmptyStatement`, which no longer exists, was the one reporting that position.
2026-08-16 02:26:11 +00:00
leaysgur
7e4f3b71cf
fix(formatter): print JSDocUnknownType ( #25729 )
...
Fixes #25704
2026-08-16 01:52:21 +00:00
leaysgur
5238d9ee10
fix(formatter): keep nested awaited-paren member chain grouped in call arguments ( #25646 )
...
Found by real-world repo testing for `operatorPosition`.
- Check the nearest nested `await` is enough
- `needs_parens` check is not needed
Now aligned with Prettier's output.
2026-08-14 08:12:16 +00:00
leaysgur
2adb8fb329
feat(formatter): implement operatorPosition option ( #25581 )
...
NOTE: For now, behavior is the same as Prettier.
- Default is `end`
- This works on intersection(`&`) type, but has no effect on union(`|`) type
For future refs: https://github.com/oxc-project/oxc/issues/16367
2026-08-14 08:12:16 +00:00
leaysgur
9fa763702b
test(formatter): normalize jsdoc fixture paths for Windows ignore matching ( #25574 )
...
Final fix for Windows CI failure.
2026-08-13 03:37:27 +00:00
leaysgur
7f350d166f
fix(formatter): keep unary comment and print only needed parens ( #25526 )
...
Fixes #25494
2026-08-12 05:36:17 +00:00
leaysgur
4544183058
test(formatter_tests,formatter,formatter_css): always track idempotency violations in snapshots ( #25512 )
...
Trackable easier than before.
2026-08-12 02:25:55 +00:00
leaysgur
b297fb1cb8
refactor(formatter,formatter_tests): fix up ( #25478 )
...
Cleaning up after the series of migrations.
- Docs clean up
- More strict `jsdoc` option handling in fixture tests
2026-08-12 00:48:33 +00:00
leaysgur
0fa91283fd
refactor(formatter,formatter_tests): move out prettier JS,TS,JSDoc conformance from tasks/ ( #25477 )
...
Migration from tasks/prettier_conformance to each crate test using oxc_formatter_tests, for JS/TS and JSDoc.
2026-08-12 00:48:32 +00:00
leaysgur
6e1b4ddceb
refactor(formatter_core,formatter_tests): extract oxc_formatter_tests crate from oxc_formatter_core ( #25465 )
...
- Extract `test_harness` feature as crate `oxc_formatter_tests`
- This crate will also provide infra for `tasks/prettier_conformance` later
2026-08-12 00:40:59 +00:00
oxc-guard
c42d6397ea
release(apps): oxlint v1.78.0 && oxfmt v0.63.0 ( #25473 )
...
# Oxlint
### 💥 BREAKING CHANGES
- a33788e ast: [**BREAKING**] Group class heritage into `ClassHeritage` (#25360 ) (camc314)
- 5c5cdcd ast: [**BREAKING**] Narrow `TSInterfaceHeritage::expression` to TSTypeName (#24360 ) (camc314)
- 6be314f ast: [**BREAKING**] Remove duplicated `VariableDeclarator::kind` (#25319 ) (camc314)
- 44fd320 ast: [**BREAKING**] Split TS external modules & Namespace Declarations (#25284 ) (camc314)
### 🚀 Features
- ccb8fe8 linter/jsdoc: Implement `no-blank-blocks` rule (#25207 ) (Mikhail Baev)
- d4a897c linter/eslint: Implement `one-var` rule (#24470 ) (Cole Ellison)
- 5ab9340 linter/jsx-a11y/anchor-has-content: Add options to match eslint (#24571 ) (Cole Ellison)
### 🐛 Bug Fixes
- b746e00 linter/eslint/no-implicit-coercion: Preserve template coercion whitespace (#25470 ) (camc314)
- a92c541 linter: Preserve source text for JS plugin ignore fixes (#25280 ) (Norcleeh)
- 675c840 linter/eslint/prefer-promise-reject-errors: Handle parenthesized calls (#25378 ) (camc314)
- 1703739 linter/unicorn/new-for-builtins: Ignore optional chains (#25411 ) (tanakalucky)
- 95ece63 linter/unicorn/prefer-code-point: Downgrade the auto-fix to dangerous (#25412 ) (leemr)
- c451a0e linter/vitest: Validate `consistent-test-filename` regex patterns (#25408 ) (Mikhail Baev)
- 937825c react_compiler: Disable exhaustive memo validation by default (#25417 ) (Boshen)
- f0f7dae linter/eslint/no-unused-vars: Report invalid regex options (#25380 ) (Cameron)
- 44e73fd linter/unicorn/prefer-array-flat: Fix `concat.apply` suggestions (#25373 ) (Cameron)
- 6846a9a linter/react/rules-of-hooks: Detect constructor callbacks (#25377 ) (camc314)
- b247a9d linter/unicorn/new-for-builtins: Support `Float16Array` (#25382 ) (tanakalucky)
- 19109cd linter/unicorn/error-message: Support `SuppressedError` messages (#25375 ) (camc314)
- 9c13f5e linter: Assert token lookup invariants (#25368 ) (camc314)
- bc35f83 linter/eslint/no-unused-vars: Bound catch parameter lookup (#25367 ) (camc314)
- c159fb9 linter/unicorn/switch-case-braces: Bound token lookup (#25363 ) (camc314)
- 03b2eb2 linter/unicorn/no-static-only-class: Bound token lookup (#25361 ) (camc314)
- 0afc59e linter/unicorn/empty-brace-spaces: Bound token lookup (#25353 ) (camc314)
- 2963d98 linter/eslint/no-unreachable-loop: Do not report loops whose body has a finally block (#25335 ) (Todor Andonov)
- 589e5fb linter/eslint/no-param-reassign: Validate `ignorePropertyModificationsForRegex` property (#25346 ) (Mikhail Baev)
- aae5d8b linter/eslint/no-throw-literal: False positive on variable declared without initializer (#25275 ) (cjnoname)
- 6b1c479 oxlint: Normalize customized rule names (#25316 ) (camc314)
- d494eb5 linter/unicorn/consistent-existence-index-check: Bound token lookup (#25325 ) (camc314)
- 4266037 linter/typescript/prefer-namespace-keyword: Bound token lookup (#25322 ) (camc314)
- 4745b4e linter/typescript/no-namespace: Bound token lookup (#25321 ) (camc314)
- 648a481 linter/eslint/one-var: Avoid joining exported declarations (#25314 ) (camc314)
- 9573937 linter/typescript: Validate `ban-ts-comment` description_format (#25320 ) (Mikhail Baev)
- ebf7d18 linter/typescript/consistent-type-definitions: Bound token lookup (#25281 ) (camc314)
- 1501ccf linter/typescript/consistent-generic-constructors: Bound token lookup (#25258 ) (camc314)
### ⚡ Performance
- 8f784f3 linter: Reduce rule config dispatch size (#25461 ) (Boshen)
- 2de4ec2 linter: Reduce visitor code size (#25441 ) (Boshen)
- 6fb7f47 linter/unicorn/prefer-export-from: Narrow `ExportFromDeclaration` lookup (#25381 ) (camc314)
- e3f6263 linter/unicorn/prefer-default-parameters: Avoid reference allocation (#25379 ) (camc314)
- d863473 linter/vue/max-props: Narrow AST dispatch (#25372 ) (camc314)
- 273d867 linter: Avoid diagnostic sorting after applying fixes (#25079 ) (Sysix)
- 4ec9189 oxlint/lsp: Avoid second lock for getting/removing unused directives (#25350 ) (Sysix)
- 6c0d01b oxlint/lsp: Preallocate fix-content vec (#25351 ) (Sysix)
- 3a94055 linter: Avoid per-call heap allocations in jest and unicorn helpers (#25210 ) (Connor Shea)
- 4abff11 linter: Avoid redundant message work in the agent reporter (#25315 ) (Connor Shea)
- 6bb5421 linter: Hoist `current_dir` out of the stylish reporter loop (#25313 ) (Connor Shea)
- 9a7c323 linter: Compute diagnostic `Info` once per diagnostic in junit reporter (#25312 ) (Connor Shea)
- 1cf7dde oxlint: Render JSON report into a single buffer (#25295 ) (connorshea)
- 8492cfd linter/typescript/ban-ts-comment: Bail early with substring guard (#25301 ) (Jacob Asper)
- 7607f04 linter/typescript/ban-tslint-comment: Replace regex with manual parser (#25299 ) (Jacob Asper)
# Oxfmt
### 💥 BREAKING CHANGES
- a33788e ast: [**BREAKING**] Group class heritage into `ClassHeritage` (#25360 ) (camc314)
- 5c5cdcd ast: [**BREAKING**] Narrow `TSInterfaceHeritage::expression` to TSTypeName (#24360 ) (camc314)
- 6be314f ast: [**BREAKING**] Remove duplicated `VariableDeclarator::kind` (#25319 ) (camc314)
- 44fd320 ast: [**BREAKING**] Split TS external modules & Namespace Declarations (#25284 ) (camc314)
### 🚀 Features
- fd02a89 oxfmt: Dispatch yaml-in-css(frontmatter) to `oxc_formatter_yaml` (#25336 ) (leaysgur)
- ab12665 formatter_core: Add `hardlineWithoutBreakParent` equivalent IR (#25273 ) (leaysgur)
### 🐛 Bug Fixes
- 95dc917 oxfmt: Drop IR Space at line start for js-in-xxx (#25460 ) (leaysgur)
- b63eccc formatter: Keep comments after TS this_param (#25459 ) (leaysgur)
- ab52a59 formatter: Format xxx-in-js inside JSDoc js fence (#25414 ) (leaysgur)
- 1a2c64a formatter,oxfmt: Apply effective print width for JSDoc fence (#25413 ) (leaysgur)
- 2eaede9 formatter_core: Unify leading-BOM handlings (#25340 ) (leaysgur)
- ef1d04b formatter: Break mapped type brackets (#25297 ) (leaysgur)
- 4e6f3f1 formatter: Break index signature brackets (#25296 ) (leaysgur)
- e23dccf formatter_css: Bump oxc-css-parser to accept unknown at-rule with interpolated (#25277 ) (leaysgur)
- c29b587 formatter_core: Measure decided-flat fill separator as flat during group re-measure (#25276 ) (leaysgur)
- f3c6953 formatter_yaml: Don't rewrite overflowing key to implicit (#25274 ) (leaysgur)
### ⚡ Performance
- c9d1a5b oxfmt: Spawn tinypool lazily (#25298 ) (leaysgur)
### 📚 Documentation
- 6eae5c9 formatter,oxfmt: Record embed-layer decisions in place (#25422 ) (leaysgur)
- 51224a7 formatter_yaml: Pin EOF blank lines divergence (#25269 ) (leaysgur)
2026-08-10 10:03:34 +00:00
Boshen
030857b509
refactor(diagnostics): update oxc-miette to v4 ( #25395 )
...
Remove the miette `Report` wrapper and update oxc-miette to v4's narrowed diagnostic and source protocol.
AI-assisted by OpenAI Codex.
2026-08-10 07:48:02 +00:00