João Guerreiro Designer & Developer
Current Status:

Guides

Linting & Formatting Setup

This guide documents how I set up and configure linting and formatting tools—ESLint, Prettier, and Stylelint—in JavaScript/React projects.

These tools help enforce consistent code quality and style across the codebase, reduce bugs, and remove friction during collaboration or solo development.

Installation

ESLint

npm init @eslint/config@latest

Follow the prompts to configure your project.

Prettier

npm install --save-dev --save-exact prettier

Then create a .prettierrc file in the root of your project.

Stylelint

npm install --save-dev stylelint stylelint-config-standard-scss

Create a stylelint.config.js file:

Coding Style

This page outlines the coding style guidelines I use across projects. These aren’t rigid rules — just practical habits that help reduce bugs and improve clarity.


Error Handling & Logging Standards

Throw Low, Catch High

A foundational rule in error handling:

“Throw low” – detect and report errors where they happen. “Catch high” – log, handle, and show user-friendly messages where you have context.

  • Low-level functions should only care about whether something worked or not.
  • High-level code (like components or services) decides how to react.

Use a Consistent Result Object

Instead of throwing exceptions everywhere, return a predictable object:

Pull Requests / Merge Requests

Template

This MR adds _[describe the feature or change in one sentence]_.  

**Key Changes:**  

- Implemented _[feature/component]_ that _[briefly explain what it does]_.  
- _[Describe any new UI elements, functionality, or logic changes]_.  
- _[Mention any user interactions or expected behavior changes]_.  

**Setup Notes:**  

- _[List any necessary migrations, environment variables, or setup steps]_.