Skip to content

Latest commit

 

History

History
40 lines (37 loc) · 746 Bytes

RECOMMENDATIONS.md

File metadata and controls

40 lines (37 loc) · 746 Bytes

Recommendations

Code

  • Don't be blinded by DRY principle

    TODO: add comments

  • Add comments - only if it's required
  • Describe props/types
type TreeItem = {
    /** Unique identifier */
    id: TreeNodeId;
    /** Name */
    name: string;
    /** Amount of related items */
    count: number;
    /** Parent identifier */
    parentId?: TreeNodeId;
}
  • Use tsdoc-like style
/**
 * Tooltip
 * @remark If you should not specify `title` props - tooltip'll be invisible
 */
const Tooltip = (props: Props) => {

Styles

  • Use css vars
    • specially - with work with colors
    • not only on app level, also at component's level
.app {
    --clr-base: #4d97fd;
    --clr-base-hover: #4d97fd1f;
    ...
}