Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/content/contribute/writers-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,21 @@
If the object's key is dynamic, user-defined, use `<key>` to describe it:

`object = { <key> string }`

### Options shortlists and their typing

Check failure on line 240 in src/content/contribute/writers-guide.mdx

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest, lts/*)

Insert `⏎`

Sometimes, we want to describe certain properties of objects and functions in lists. When applicable add typing directly to the list where properties are enlisted:
Sometimes, we want to describe certain properties of objects and functions in lists. When applicable, add typing directly to the list where properties are enlisted:

- `madeUp` (`boolean = true`): short description
- `shortText` (`string = 'i am text'`): another short description

W> `:` is not a necessity here, note the property, type and default.

An example can be found on the [`options` section of the EvalSourceMapDevToolPlugin's page](/plugins/eval-source-map-dev-tool-plugin/#options).
In general, prefer consistent and familiar notation styles when documenting types.

For function signatures, use a clear argument and return type format:

### Adding links
`function (arg1: string, arg2: number) => boolean`

Please use relative URLs (such as `/concepts/mode/`) to link our own content instead of absolute URLs (such as `https://webpack.js.org/concepts/mode/`).
Avoid mixing multiple type styles (e.g., JSDoc and inline notation) within the same section, as it can reduce readability and consistency.

An example can be found on the [`options` section of the EvalSourceMapDevToolPlugin's page](/plugins/eval-source-map-dev-tool-plugin/#options).
Loading