Skip to content

Latest commit

 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ale0aranda/rules

Shared development rules and presets for Alejandro Aranda's projects.

The package provides configurations for:

  • Biome
  • Commitlint with Conventional Commits and emojis
  • TypeScript
  • Renovate

Requirements

  • Node.js 22.13 or newer
  • Biome 2
  • Commitlint 21
  • TypeScript 5.7 or newer

Installation

pnpm add -D @ale0aranda/rules @biomejs/biome @commitlint/cli typescript

For Node.js projects, also install its type definitions:

pnpm add -D @types/node

Biome

Create a biome.json file:

{
  "extends": ["@ale0aranda/rules/biome"]
}

The preset includes:

  • Two-space indentation
  • Single quotes
  • Required semicolons
  • No trailing commas
  • 80-character line width
  • Organized imports
  • Type-only import groups
  • CSS and Tailwind CSS support
  • Recommended lint rules

You can override any setting locally:

{
  "extends": ["@ale0aranda/rules/biome"],
  "formatter": {
    "lineWidth": 100
  }
}

Commitlint

Create commitlint.config.mjs:

export { default } from '@ale0aranda/rules/commitlint';

Example commits:

✨ feat: add user authentication
🐛 fix(api): handle missing token
📚 docs: update installation guide
♻️ refactor(core): simplify configuration
✅ test: cover package exports
🔧 chore: update tooling
🚀 ci: automate releases

Validate a commit manually:

echo "✨ feat: add shared rules" | pnpm exec commitlint

TypeScript

Base

{
  "extends": "@ale0aranda/rules/typescript/base",
  "compilerOptions": {
    "noEmit": true
  },
  "include": ["src"]
}

Web

Recommended for browser projects, Astro, React, Vue and Svelte:

{
  "extends": "@ale0aranda/rules/typescript/web",
  "include": ["src"]
}

Node.js

{
  "extends": "@ale0aranda/rules/typescript/node",
  "include": ["src"]
}

npm library

{
  "extends": "@ale0aranda/rules/typescript/library",
  "include": ["src"]
}

The shared TypeScript settings include:

  • Strict type checking
  • JavaScript type checking
  • Exact optional properties
  • Bracket access for index signatures
  • Isolated modules
  • Verbatim module syntax
  • Biome-managed unused variables

Renovate

Install the Renovate GitHub App and create renovate.json:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["github>ale0aranda/rules"]
}

The preset provides:

  • Weekly dependency updates
  • Dependency Dashboard
  • Three-day minimum release age
  • Grouped non-major updates
  • Separate major update approval
  • GitHub Actions updates
  • Conventional commits with emojis
  • pnpm lockfile deduplication

To use a fixed release of the preset:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["github>ale0aranda/rules#v0.3.0"]
}

Available exports

Export Purpose
@ale0aranda/rules/biome Biome configuration
@ale0aranda/rules/commitlint Commitlint configuration
@ale0aranda/rules/typescript/base Base TypeScript configuration
@ale0aranda/rules/typescript/web Browser and framework projects
@ale0aranda/rules/typescript/node Node.js projects
@ale0aranda/rules/typescript/library Published npm libraries
@ale0aranda/rules/renovate Renovate preset file

Renovate should normally consume the GitHub-hosted preset instead of the npm export.

Development

Install dependencies:

pnpm install

Format the repository:

pnpm format

Run every check:

pnpm check

Inspect package contents:

pnpm pack --dry-run

Releases

Create one changeset for each publishable feature or fix:

pnpm changeset

Changesets creates a version pull request. Merging that pull request publishes the package automatically through npm Trusted Publishing.

A changeset is not required for documentation, tests, CI changes or development dependency updates that do not affect consumers.

License

MIT

About

⚙️ Unified tooling and strict configuration presets to scale modern Web & Node.js codebases.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages