docs(formatter_css,formatter_yaml): point parser citations at AGENTS.md (#28466)

This commit is contained in:
Yuji Sugiura authored and GitHub committed 2026-10-30 13:05:54 +09:00
1 parent e16f8d70b9
commit a363c2765f
7 files changed
+13 -13

No files matched your search

+3 -3
View File
@@ -25,7 +25,7 @@ The fork adds:
- the css-in-js parse mode, enabled only by `format_to_ir`
- Rationale, gating and per-position coverage: see "css-in-js specifics" below
- Bug fixes toward the reference compilers for valid CSS/SCSS/Less syntax `raffia` miss parses or rejects;
- The acceptance line: the fork's README "Acceptance", see "Acceptance" below
- The acceptance line: see "Acceptance" below
Prettier operates on `postcss` + three sub-parsers (`postcss-selector-parser`, `postcss-values-parser`, `postcss-media-query-parser`) and depends on `raws` (source gaps).
@@ -36,7 +36,7 @@ Prettier operates on `postcss` + three sub-parsers (`postcss-selector-parser`, `
The shared policy applies; CSS specifics:
- `oxc-css-parser` is error-tolerant via `parser.recoverable_errors()`, but any parse error still bails out
- `TopLevelDeclaration`: a root declaration in Css and Scss, so standalone `format()` rejects it (README "Acceptance")
- `TopLevelDeclaration`: a root declaration in Css and Scss, so standalone `format()` rejects it (oxc-css-parser AGENTS.md "Acceptance")
- `format_to_ir()` parses a fragment (`CssRoot::Fragment`, the parser's `block_contents`): the root follows the rules inside a block, so it is a statement
- `` css`display: flex;` `` is the dominant css-in-js shape, and MDN-style property snippets in Markdown code blocks
- Less parses and formats it: less.js accepts it at parse time and fails only at eval
@@ -129,7 +129,7 @@ FM behavior is verified through oxfmt; this crate carries no dispatcher-wired FM
### Acceptance
What the parser takes in is the oxc-css-parser's README "Acceptance": one grammar owner per variant.
What the parser takes in is oxc-css-parser AGENTS.md "Acceptance": one grammar owner per variant.
Never "postcss keeps the bytes", never "Prettier prints it".
The formatter's side: postcss gives Prettier statements whose selectors, values and params are strings, and Prettier re-tokenizes those with its own sub-parsers and word rules.
+1 -1
View File
@@ -1450,7 +1450,7 @@ a {
/* prettier: CssSyntaxError: Missed semicolon, the input is left as-is */
```
A `;`-less declaration runs to the next `;`: `oxc-css-parser` reads one declaration, a value being any component-value run (css-syntax-3; its README "Acceptance");
A `;`-less declaration runs to the next `;`: `oxc-css-parser` reads one declaration, a value being any component-value run (css-syntax-3; oxc-css-parser AGENTS.md "Acceptance");
postcss rejects a value with a `word:` after its first word.
Same tokens, so same meaning: a browser drops the declaration,
or keeps it the same way when the value holds an arbitrary substitution function (`var()`, `env()`).
@@ -1,5 +1,5 @@
// The dominant css-in-js shape: bare root declarations with no enclosing rule.
// The css-in-js parse mode parses them as statements (oxc-css-parser README
// The css-in-js parse mode parses them as statements (oxc-css-parser AGENTS.md
// "Acceptance"); standalone `format()` rejects them, asserted in `parse_error_is_err`.
display: flex;
@@ -3,7 +3,7 @@ source: crates/oxc_formatter_css/tests/fixtures/mod.rs
---
==================== Input ====================
// The dominant css-in-js shape: bare root declarations with no enclosing rule.
// The css-in-js parse mode parses them as statements (oxc-css-parser README
// The css-in-js parse mode parses them as statements (oxc-css-parser AGENTS.md
// "Acceptance"); standalone `format()` rejects them, asserted in `parse_error_is_err`.
display: flex;
@@ -18,7 +18,7 @@ color: red;
{ printWidth: 80 }
------------------
// The dominant css-in-js shape: bare root declarations with no enclosing rule.
// The css-in-js parse mode parses them as statements (oxc-css-parser README
// The css-in-js parse mode parses them as statements (oxc-css-parser AGENTS.md
// "Acceptance"); standalone `format()` rejects them, asserted in `parse_error_is_err`.
display: flex;
@@ -32,7 +32,7 @@ color: red;
{ printWidth: 100 }
-------------------
// The dominant css-in-js shape: bare root declarations with no enclosing rule.
// The css-in-js parse mode parses them as statements (oxc-css-parser README
// The css-in-js parse mode parses them as statements (oxc-css-parser AGENTS.md
// "Acceptance"); standalone `format()` rejects them, asserted in `parse_error_is_err`.
display: flex;
@@ -1,5 +1,5 @@
/* A Css property name is postcss's glued token run, not necessarily an ident
(oxc-css-parser README "Acceptance"). Prettier prints it verbatim, lowercased. */
(oxc-css-parser AGENTS.md "Acceptance"). Prettier prints it verbatim, lowercased. */
.hacks {
*zoom: 1;
_width: 200px;
@@ -3,7 +3,7 @@ source: crates/oxc_formatter_css/tests/fixtures/mod.rs
---
==================== Input ====================
/* A Css property name is postcss's glued token run, not necessarily an ident
(oxc-css-parser README "Acceptance"). Prettier prints it verbatim, lowercased. */
(oxc-css-parser AGENTS.md "Acceptance"). Prettier prints it verbatim, lowercased. */
.hacks {
*zoom: 1;
_width: 200px;
@@ -48,7 +48,7 @@ source: crates/oxc_formatter_css/tests/fixtures/mod.rs
{ printWidth: 80 }
------------------
/* A Css property name is postcss's glued token run, not necessarily an ident
(oxc-css-parser README "Acceptance"). Prettier prints it verbatim, lowercased. */
(oxc-css-parser AGENTS.md "Acceptance"). Prettier prints it verbatim, lowercased. */
.hacks {
*zoom: 1;
_width: 200px;
@@ -92,7 +92,7 @@ source: crates/oxc_formatter_css/tests/fixtures/mod.rs
{ printWidth: 100 }
-------------------
/* A Css property name is postcss's glued token run, not necessarily an ident
(oxc-css-parser README "Acceptance"). Prettier prints it verbatim, lowercased. */
(oxc-css-parser AGENTS.md "Acceptance"). Prettier prints it verbatim, lowercased. */
.hacks {
*zoom: 1;
_width: 200px;
+1 -1
View File
@@ -38,7 +38,7 @@ A leading BOM is stripped before parsing and re-emitted by `format()`.
### Line starts
A line the printer starts at column 0 must not read back as stream-level syntax (see the parser README "Input acceptance"):
A line the printer starts at column 0 must not read back as stream-level syntax (see the parser's AGENTS.md "Input acceptance"):
- `---`/`...` followed by a blank or the end is a document marker
- U+FEFF outside a document is a BOM