File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,20 @@ src/content/api/
134134- Versioned: ` /en/5x/api/application ` → Express 5.x application API
135135- Non-versioned: ` /en/api/application ` → Defaults to Express 5.x
136136
137+ ### Style Conventions
138+
139+ The reference pages for every version follow the same conventions, so that switching between
140+ Express 4.x and 5.x only shows real API differences:
141+
142+ - Property and method sections are listed alphabetically, so ` req.host ` comes before ` req.hostname ` .
143+ - Result comments in code samples use single quotes, matching the Prettier ` singleQuote ` setting:
144+ ` res.type('png'); // => 'image/png' ` . Double quotes are kept only where the sample shows JSON or a
145+ raw HTTP header.
146+ - The frontmatter ` description ` of the request and response pages repeats the opening sentence of the
147+ page, which refers to the objects as ` req ` and ` res ` rather than spelling out their full names.
148+
149+ ` tests/unit/api-docs-style.test.mjs ` checks these conventions, and it runs as part of ` npm run test:unit ` .
150+
137151## Versioning
138152
139153The Express.js documentation supports multiple versions. Content is organized by version in both the ` docs ` and ` api ` collections.
You can’t perform that action at this time.
0 commit comments