mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
chore: add comment style rules to eslint config
Add ESLint rules to enforce comment style: - Require space after // in single-line comments - Prefer JSDoc style for multi-line comments - Warn on TODO/FIXME/HACK comments - Update documentation with comment style guide
This commit is contained in:
@@ -89,6 +89,13 @@ From `eslint.config.mjs` and detailed in `LINTING.md`:
|
|||||||
- Max lines per function: 100
|
- Max lines per function: 100
|
||||||
- Max nesting depth: 4
|
- 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
|
## Git Commit Format
|
||||||
|
|
||||||
Follow Conventional Commits format. See `.gitmessage` for full rules.
|
Follow Conventional Commits format. See `.gitmessage` for full rules.
|
||||||
|
|||||||
@@ -129,6 +129,31 @@ export default tseslint.config(
|
|||||||
ignoreDeclarationSort: true,
|
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',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user