Skip to content

Commit

Permalink
add more details to the satisfies operator section
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed May 9, 2024
1 parent 221df2c commit 9f609de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,11 @@ const sizingStyles = {
mw100: {
maxWidth: '100%',
},
} satisfies Record<string, ViewStyle>;
} as const satisfies Record<string, ViewStyle>;
```

The example above results in the most narrow type possible, also the values are `readonly`. There are some cases in which that is not desired (e.g. the variable can be modified), if so `as const` should be omitted.

### Type imports/exports

Always use the `type` keyword when importing/exporting types
Expand Down

0 comments on commit 9f609de

Please sign in to comment.