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
Import only React and use members from there instead of separate imports
// GoodimportReactfrom'react';
// BadimportReact,{useState}from'react';
// Badimport*asReactfrom'react';
Use type instead of interface
// GoodexporttypeAlertProps={ ... };
// BadexportinterfaceIAlertProps{}
Comment all props in multiline using jsdoc
// GoodexporttypeAlertProps={/** * Type of the alert. * @default 'informational' */type?: 'positive'|'warning'|'negative'|'informational';
...
// Bad (single line)exporttypeAlertProps={/** Type of the alert. */type?: 'positive'|'warning'|'negative'|'informational';
...
// Bad (no comment at all)exporttypeAlertProps={type?: 'positive'|'warning'|'negative'|'informational';
...
Add description and example how to use the component
// Good/** * A small box to quickly grab user attention and communicate a brief message. * @example * <Alert>This is a basic alert.</Alert> */exportconstAlert=(props: AlertProps)=>{
...
// Bad (no comments)exportconstAlert=(props: AlertProps)=>{
...
// Bad (no example)/** * A small box to quickly grab user attention and communicate a brief message. */exportconstAlert=(props: AlertProps)=>{
...