Skip to content

Commit 3c8ba41

Browse files
authored
Add TS syntax support to require-readonly-react-props (#54)
1 parent 74bc494 commit 3c8ba41

File tree

5 files changed

+7344
-7261
lines changed

5 files changed

+7344
-7261
lines changed

.README/rules/require-readonly-react-props.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,21 @@ Optionally, you can enable support for [implicit exact Flow types](https://mediu
9696
```
9797

9898

99+
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`.
100+
101+
102+
```js
103+
{
104+
"rules": {
105+
"ft-flow/require-readonly-react-props": [
106+
2,
107+
{
108+
"useExperimentalTypeScriptSyntax": true
109+
}
110+
]
111+
}
112+
}
113+
```
114+
115+
99116
<!-- assertions requireReadonlyReactProps -->

CONTRIBUTING.md

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

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

0 commit comments

Comments
 (0)