Shared development rules and presets for Alejandro Aranda's projects.
The package provides configurations for:
- Biome
- Commitlint with Conventional Commits and emojis
- TypeScript
- Renovate
- Node.js 22.13 or newer
- Biome 2
- Commitlint 21
- TypeScript 5.7 or newer
pnpm add -D @ale0aranda/rules @biomejs/biome @commitlint/cli typescriptFor Node.js projects, also install its type definitions:
pnpm add -D @types/nodeCreate 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
}
}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{
"extends": "@ale0aranda/rules/typescript/base",
"compilerOptions": {
"noEmit": true
},
"include": ["src"]
}Recommended for browser projects, Astro, React, Vue and Svelte:
{
"extends": "@ale0aranda/rules/typescript/web",
"include": ["src"]
}{
"extends": "@ale0aranda/rules/typescript/node",
"include": ["src"]
}{
"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
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"]
}| 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.
Install dependencies:
pnpm installFormat the repository:
pnpm formatRun every check:
pnpm checkInspect package contents:
pnpm pack --dry-runCreate one changeset for each publishable feature or fix:
pnpm changesetChangesets 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.