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.
The Printer never consumes these; they belong with each language formatter.
- Evict `Quote` (each formatter owns `QuoteStyle`)
- `normalize_string` takes a quote byte
- Evict `Expand` / `BracketSpacing` / `TrailingCommas` into oxc_formatter and oxc_formatter_json
- JSON's `TrailingCommas` is now two-variant (`Always`/`Never`)
- collapse Prettier's `all`/`es5` at each translation layer
- Rename `util/` -> `spec/` (pure shared helpers)
- Split `SourceText`: mechanical access stays in core, JS/TS lexis moves to `SourceTextExt`
- Drop the `oxc_syntax` dependency from core
All behaviros, Prettier conformance are unchanged.
Implement `oxc_formatter_json`'s `Jsonc` variant.
The difference between `json` and `jsonc`:
- `jsonc` allows comment only input, `json` does not
- `jsonc` refers `trailingComma` option, `json` does not
Input:
```json
[1, 2, 3] // if this comment is too long and >= printWidth
```
Before:
```json
[
1,
2,
3
] // if this comment is too long and >= printWidth
```
After:
```json
[1, 2, 3] // if this comment is too long and >= printWidth
```
Extract the fixture-based snapshot test harness from `oxc_formatter` into two `oxc_formatter_core` modules behind a `test_harness` feature:
- `test_support/codegen`:
- Language-agnostic `build.rs` helper that walks `tests/fixtures/` and emits `#[test]` functions to `$OUT_DIR`
- Extension allowlist is now a parameter instead of hardcoded JS types.
- `test_support/harness`:
- Snapshot-runtime that drives one format pass per option set × per printWidth (80, 100) and asserts via `insta`
- Per-language hook is the new `FixtureFormatter` trait