This page summarizes the style rules that matter most when contributing to the current repository.
- keep changes small and local to the real problem
- match existing naming and file structure
- prefer straightforward TypeScript over clever abstractions
- update docs when public behavior changes
- fix generator source or shared runtime, not generated files by hand
Prettier is the source of truth for formatting.
Current repository formatting:
- semicolons enabled
- single quotes
- trailing commas in ES5 positions
printWidth: 100- two-space indentation
- LF line endings
Use these commands when needed:
npm run format
npm run format:checkESLint is configured with TypeScript type-aware rules.
Use:
npm run lint
npm run lint:fixImportant enforced rules in the current config include:
- no unused variables unless prefixed with
_ prefer-constno-vareqeqeqcurly- no floating promises
- limited use of
@ts-ignoreand similar comments
Some unsafe-* TypeScript rules are intentionally relaxed for src/module/** because Nuxt types resolve differently there.
- keep
strictmode assumptions intact - prefer explicit domain types over
any - use
unknownwhen the value is genuinely unknown - convert route params and external values explicitly instead of relying on coercion
- prefer option objects when a function needs many related inputs
Use the existing repository conventions:
camelCasefor functions and variablesPascalCasefor exported types and interfaces- clear generator names that match the product surface
- public config should use current OpenAPI terminology, not removed legacy names
Keep imports readable and stable.
A good default order is:
- Node built-ins
- external packages
- local project modules
- type-only imports
Follow the surrounding file when the repository already has a settled pattern.
Comments should explain intent, constraints, or tricky behavior.
Avoid comments that merely restate obvious code.
Good places for short comments in this repository:
- why a runtime fallback exists
- why a Nuxt module rule is relaxed
- why a generator preserves a compatibility behavior
Do not hand-edit generated files as the real fix.
If you regenerate output as part of a change, the generated diff should be the consequence of changes in:
src/generate.tssrc/generators/**src/config/**src/module/**
Public names in code and docs should stay aligned. In this repository that usually means:
openapias the module config keyopenapi/as the default output rootruntimeConfig.public.apiBaseUrlfor client fallbackserver/routes/apias the defaultnuxtServerroute output