Closed osmestad closed 4 years ago
If using Flow's object level annotation for read only (https://flow.org/en/docs/types/utilities/#toc-readonly), react/prefer-read-only-props rule will require each attribute in the object to be read-only too.
react/prefer-read-only-props
Example code that is read only:
props: $ReadOnly<{| dataTest?: string, className?: string, |}>,
This rule would require:
props: $ReadOnly<{| +dataTest?: string, +className?: string, |}>,
Which should not really be needed :-) I guess it might make the rule a bit more complex to implement though? (using Flow: 0.110.0, eslint-plugin-react: 7.16.0, eslint: 6.5.1)
I think this is very similar issue to this one: #2358 (which was for the no-unused-prop-types rule)
no-unused-prop-types
It seems like we should support this.
I'm going to give this a try
If using Flow's object level annotation for read only (https://flow.org/en/docs/types/utilities/#toc-readonly),
react/prefer-read-only-props
rule will require each attribute in the object to be read-only too.Example code that is read only:
This rule would require:
Which should not really be needed :-) I guess it might make the rule a bit more complex to implement though? (using Flow: 0.110.0, eslint-plugin-react: 7.16.0, eslint: 6.5.1)