Rules and Conventions
In order to enforce a consistent code style and avoid common issues in the codebase, we have a set of rules and conventions that we follow and enforce through the project.
Typescript
This starter uses TypeScript to provide type safety and avoid common bugs in the codebase. The project configuration is based on T3 Stack with some updates.
If you are not familiar with Typescript, you can check this article to learn more about it : Typescript for React Developers
You can find more information about it here.
Naming
We follow kabab-case for naming files and folders as we think it’s the most readable and consistent way to name files and folders in large projects and it’s the most common way to name files and folders in the React community.
Example of kabab-case naming: my-component.tsx
For naming variables, functions, classes, interfaces, and enums, we follow camelCase as it’s the most common way to name variables in the React community.
Example of camelCase naming: const myFunction = () => {}
Linting
Using a linter is a must in any JavaScript project. For starters, we are using ESLint with the T3 Stack config and some custom rules to ensure that we are following the rules and conventions related to file naming, Tailwind CSS classes, TypeScript types, import order, and more.
Here is the complete ESLint configuration file: