Code Style Guide

Coding standards and style guidelines for Gconv Prune

Overview

Learn about our coding standards and style guidelines to maintain consistency across the Gconv Prune codebase.

TypeScript Guidelines

Type Definitions

// Good
type User = {
  id: string;
  name: string;
  email: string;
  role: "admin" | "user";
};

// Bad
type User = {
  id: any;
  name: any;
  email: any;
  role: string;
};

React Components

Component Structure

import React from "react";

type Props = {
  title: string;
  children: React.ReactNode;
};

export function MyComponent({ title, children }: Props) {
  return (
    <div>
      <h1>{title}</h1>
      {children}
    </div>
  );
}

Naming Conventions

  • Use PascalCase for component names
  • Use camelCase for variables and functions
  • Use UPPER_SNAKE_CASE for constants
  • Use kebab-case for file names

Need Help?

For code style questions, check our troubleshooting guide or contact our support team.