diff --git a/CLAUDE.md b/CLAUDE.md index a4e4149..475cdfe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -89,6 +89,13 @@ From `eslint.config.mjs` and detailed in `LINTING.md`: - Max lines per function: 100 - Max nesting depth: 4 +4. **Comments Style:** + - Single-line comments must have a space after `//` (e.g., `// Comment`) + - Multi-line comments should use JSDoc style (`/** */`) + - No section divider comments (e.g., `// Entities`, `// Value Objects`) in code + - Comments should explain "why", not "what" (code should be self-documenting) + - TODO/FIXME/HACK comments trigger warnings + ## Git Commit Format Follow Conventional Commits format. See `.gitmessage` for full rules. diff --git a/eslint.config.mjs b/eslint.config.mjs index 1e894c5..44da2a6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -129,6 +129,31 @@ export default tseslint.config( ignoreDeclarationSort: true, }, ], + + // ======================================== + // Comments + // ======================================== + 'no-inline-comments': 'off', + 'line-comment-position': 'off', + 'spaced-comment': [ + 'error', + 'always', + { + markers: ['/'], + exceptions: ['-', '+', '*', '='], + block: { + balanced: true, + }, + }, + ], + 'multiline-comment-style': ['warn', 'starred-block'], + 'no-warning-comments': [ + 'warn', + { + terms: ['todo', 'fixme', 'hack', 'xxx'], + location: 'start', + }, + ], }, }, );