You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and my issue is unique
My issue appears in the command-line and not only in the text editor
Description Overview
When I add react/prefer-read-only-props it doesn't detect read/write props defined using Typescript. The documentation suggests only towards the detection of types defined in Flow, so it makes sense (to me) that this rule can perform the same detection for Typescript as well.
I'm not sure what to do about advanced usage, so when pulling extra interfaces from other files, and unioning them into the ImageProps interface.
Expected Behavior
This rule should not only check Flow, but also Typescript.
Perhaps also a good idea to enforce how readonlyness is achieved (readonly keyword, ReadOnly<T> type, or React.FC<ReadOnly<T>> component, or something else?)
eslint-plugin-react version
7.32.2
eslint version
8.34.0
node version
18.13.0
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Description Overview
When I add
react/prefer-read-only-props
it doesn't detect read/write props defined using Typescript. The documentation suggests only towards the detection of types defined in Flow, so it makes sense (to me) that this rule can perform the same detection for Typescript as well.Example of incorrect code:
Examples of correct code:
I'm not sure what to do about advanced usage, so when pulling extra interfaces from other files, and unioning them into the
ImageProps
interface.Expected Behavior
This rule should not only check Flow, but also Typescript.
Perhaps also a good idea to enforce how readonlyness is achieved (
readonly
keyword,ReadOnly<T>
type, orReact.FC<ReadOnly<T>>
component, or something else?)eslint-plugin-react version
7.32.2
eslint version
8.34.0
node version
18.13.0
The text was updated successfully, but these errors were encountered: