Skip to content

Commit

Permalink
Add TS syntax support to require-readonly-react-props (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
short-dsb committed Mar 1, 2024
1 parent 74bc494 commit 3c8ba41
Show file tree
Hide file tree
Showing 5 changed files with 7,344 additions and 7,261 deletions.
17 changes: 17 additions & 0 deletions .README/rules/require-readonly-react-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,21 @@ Optionally, you can enable support for [implicit exact Flow types](https://mediu
```


If you’re using [experimental TypeScript syntax](https://github.com/facebook/flow/blob/main/Changelog.md#02290) via the `experimental.ts_syntax=true` Flow option, you can adjust this lint rule to check for that syntax, e.g., `Readonly` versus `$ReadOnly`.


```js
{
"rules": {
"ft-flow/require-readonly-react-props": [
2,
{
"useExperimentalTypeScriptSyntax": true
}
]
}
}
```


<!-- assertions requireReadonlyReactProps -->
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Run with `yarn lint`.
* Use [./.README/rules/require-valid-file-annotation.md](./.README/rules/require-valid-file-annotation.md) as a template.
* Ensure that rule documentation document includes `<!-- assertions spaceAfterTypeColon -->` declaration.
2. Update [./.README/README.md](/.README/README.md) to include the new rule.
3. Run `npm run create-readme` to generate the new `README.md` (you must be on `master` branch for this command to work)
3. Run `yarn create-readme` to generate the new `README.md` (you must be on `master` branch for this command to work)

Note: Sections "The following patterns are considered problems:" and "The following patterns are not considered problems:" are **generated automatically** using the test cases.
Loading

0 comments on commit 3c8ba41

Please sign in to comment.