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
based on react 19 documentation prop-types is gone, so for JS users the only way to manage it is using JSDoc, can be possible to support jsdoc prop-type validation in eslint-plugin-react ?
Example
/** * @param {{ * content?: string, * requiredParameter: string // required parameter if not can be with "?" * }} props * @returns {React.ReactElement} */constChildElement=props=>{const{ content =''}=props;return<div>{content}</div>;};/** @returns {React.ReactElement} */constParentElement=()=>{return<ChildElementcontent="Hello World"wrongParameter="test"/>;};
in this example
wrongParameter should be marked as error due that is not in ChildElement JSDocs
whole component should mark an error due that requiredParameter that exists in the JSDoc is not defined from the parent element
the intention of this request if to give some ways in javascrit to work without involve typescript to maange types and props
The text was updated successfully, but these errors were encountered:
Unfortunately, type checking is a very complex task and out of the capabilities that a eslint plugin can provide (you need to look across files to start, which as far as I know isn't supported by ESLint).
For static type checking TypeScript (and Flow) are the supported ways.
Summary
based on react 19 documentation
prop-types
is gone, so for JS users the only way to manage it is using JSDoc, can be possible to support jsdoc prop-type validation in eslint-plugin-react ?Example
in this example
the intention of this request if to give some ways in javascrit to work without involve typescript to maange types and props
The text was updated successfully, but these errors were encountered: