17 Commits
Author SHA1 Message Date
Yuji SugiuraandClaude Opus 5.5 b1def652d3 test(formatter_htmlish): rename nul fixture directory for Windows (#28522)
`crates/oxc_formatter_htmlish/tests/fixtures/html/nul/` (added in
#28272) uses `nul`, a reserved device name on Windows, which breaks all
Windows jobs on main:

- `Test Windows`: `error: invalid path
'crates/oxc_formatter_htmlish/tests/fixtures/html/nul/nul-as-written.html'`
- `Test NAPI * (windows)`: `Could not find a part of the path '\\.\nul'`
while downloading the repo as a local action

Renamed the directory to `nul-byte/` and updated the `.gitattributes`
entry and the `DIVERGENCES.md` pin. The snapshot content is unchanged.

`cargo test -p oxc_formatter_htmlish` passes
(`fixtures::html::nul_byte::nul_as_written` included).

This PR was created with AI assistance (Claude Code).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 07:40:34 +00:00
Yuji Sugiura 44d8c2b824 feat(formatter_htmlish): Implement HTML-ish formatter Html variant (#28272)
Part of #28263
2026-10-30 16:00:59 +09:00
Boshen 2e3126c1cf fix(regex): decode constructor patterns and flags consistently (#28298)
RegExp constructor source must decode to the same pattern and flags as
JavaScript string/template values. Correct escape values, continuations,
surrogate pairing, line endings, and escaped property aliases.

AI-assisted implementation.
2026-10-29 16:30:18 +08:00
Boshen 91a638d109 fix(parser): normalize raw template line endings with invalid escapes (#28285)
Template raw values must normalize CR and CRLF even when an invalid
escape leaves the cooked value undefined.

AI-assisted implementation.
2026-10-29 16:30:15 +08:00
leaysgur 7717813ee7 feat(formatter_markdown): implement markdown formatter (#26434)
- [x] Add `oxc_formatter_markdown` crate
  - `publish = false` as always
- [x] Implement basic syntax formatting
- [x] Implement GFM, extended syntaxes
- [x] Support directive container `::: foo`
- [x] Fixed reported, upstream bugs
- [x] Publish `oxc_markdown_parser` and use it
- [x] Bump `Cargo.toml` version
- [x] ~~Embedded code fence w/ Oxfmt integration~~ => Later PR
2026-09-18 08:28:32 +00:00
leaysgur d80ad7acd9 fix(ci): add jsdoc fixtures to gitattrs entry (#25571)
Fixes Windows CI issue: https://github.com/oxc-project/oxc/actions/runs/31656149983/job/94310931760
2026-08-13 02:19:37 +00:00
leaysgur 2357a10dfa feat(formatter_yaml): implement YAML formatter (#24534)
Add `oxc_formatter_yaml` crate using `oxc_yaml_parser`.
2026-07-23 05:02:59 +00:00
leaysgur cc8db2b11c refactor(formatter_graphql): fix up code and comments (#23488)
Finally fixed up Fable's work.
2026-06-29 03:15:27 +00:00
leaysgur f21ed2c112 fix(formatter_json): normalize CRLF for suppressed text (#23702)
The same as #23701, for JSON formatter.
2026-06-22 05:32:31 +00:00
leaysgur b27c19ebd8 chore(formatter): fix .gitattributes pattern for CLRF fixtures (#23699)
There was an error in the path specification...
2026-06-22 05:16:12 +00:00
connorshea 8166f80b41 chore(linter): Misc improvements to help prevent merge conflicts for generated files in oxlint (#18813)
- The header on rules_enum.rs was being stripped by accident, which was confusing for users. So I fixed that.
- Mark the generated files as generated in `.gitattributes`, for GitHub to understand the diffs are mostly pointless and can be collapsed by default (the CI job enforces that these files be up to date anyway).
- Mark the generated rule files as `merge=ours`. See https://git-scm.com/book/ms/v2/Customizing-Git-Git-Attributes for more info on what that means, but it should make the merge conflicts less problematic.
- Updated `just ready` to include the lintgen command.
- Added `cargo lintgen` to the AGENTS.md file.

AI Disclosure: Used Claude to find the reason for the lack of header comment because I had no idea why it was happening.
2026-02-01 20:18:39 +00:00
leaysgur 1a02f6ee8c test(oxfmt): Arrange test files and directries (#17822)
Sorry for the large diff! 🙇🏻

But it's mostly just file relocations (and path updates).
Details on the changes are also documented in [`AGENTS.md`](https://github.com/oxc-project/oxc/pull/17822/changes#diff-b9a8ddc83e0b93133df7274e37b5fcdaec808090721eec2194782fe968819e69), so please refer to that file.

TL;DR: I wanted to colocate test cases and fixtures in the same directory.
2026-01-09 15:11:35 +00:00
Dunqing 75393e74ec fix(formatter): incorrect handling of CRLF for multiline block comment (#16528)
close: #16405

In Windows, a multiline block comment contains a `\r\n` line break. However, the printer assumes all text has no `\r` at all; see #16531. In this PR, we use `LineTerminatorSplitter` to normalize all line breaks to `\n` to solve this problem.
2025-12-06 15:29:23 +00:00
leaysgur 462f340795 fix(oxfmt): Adjust .gitattribute (#15297)
Hopefully fixes #15296

👉🏻 It works: https://github.com/oxc-project/oxc/actions/runs/19096746575/job/54558580497?pr=15297
2025-11-05 09:23:21 +00:00
leaysgur a9d50a7100 ci(formatter): Use gitattributes for CRLF normalization (#14614)
Confirmed: https://github.com/oxc-project/oxc/actions/runs/18518203278/job/52772706102
2025-10-16 07:29:37 +00:00
camc314 46a88f1dfa test(oxlint): update .gitattributes to force lf line endings (#14404) 2025-10-07 10:58:34 +00:00
leaysgur afa2297fd1 test(oxfmt): Fix failing tests on Windows (#13801)
Introduce https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings

Without this, the `oxfmt` tests will fail because:

- The committed test fixtures use `<LF>` as the EOL character on MacOS
  - There are no formatting diffs
- On Windows CI, these EOL characters are automatically converted to `<CRLF>`
- The formatter then changes these back to `<LF>`
- This difference causes the CI to fail

Initially, I tried to set it globally, but since CI failed, limited it to the minimum scope... 🫤

> https://github.com/oxc-project/oxc/pull/13803
2025-09-16 08:12:12 +00:00