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
15 changes: 14 additions & 1 deletion website/docs/types/mapped-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ type MappedType = {[key in Union]: number};
To use mapped types, you need to upgrade your infrastructure so that it supports the syntax:

- `flow` and `flow-parser`: 0.210.0. Between v0.210.0 to v0.211.1, you need to explicitly enable it in your .flowconfig, under the `[options]` heading, add `mapped_type=true`.
- `prettier`: 3
- `prettier`: 3. Using hermes-parser via [prettier-plugin-hermes-parser](https://npmjs.com/package/prettier-plugin-hermes-parser):
```json
{
"plugins": ["prettier-plugin-hermes-parser"],
"overrides": [
{
"files": ["*.js", "*.jsx", "*.flow"],
"options": {
"parser": "hermes"
}
}
]
}
```
- `babel` with `babel-plugin-syntax-hermes-parser`. See [our Babel guide](../../tools/babel/) for setup instructions.
- `eslint` with `hermes-eslint`. See [our ESLint guide](../../tools/eslint/) for setup instructions.