You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Path separators**: Never hard-code `/` or `\` in paths
63
+
- Use `path.sep` when you need the separator character
64
+
- Use `path.join()` to construct paths correctly
65
+
-**File URLs**: Use `pathToFileURL()` and `fileURLToPath()` from `node:url` when working with file:// URLs
66
+
-**Line endings**: Be aware of CRLF (Windows) vs LF (Unix) differences when processing text files
67
+
-**Shell commands**: Consider platform differences in shell commands and utilities
68
+
52
69
### Git Commit Guidelines
53
70
-**🚨 FORBIDDEN**: NEVER add Claude co-authorship or Claude signatures to commits
54
71
-**🚨 FORBIDDEN**: Do NOT include "Generated with Claude Code" or similar AI attribution in commit messages
@@ -140,9 +157,19 @@ This is a JavaScript implementation of the Package URL (purl) specification for
140
157
### 🏗️ Code Structure (CRITICAL PATTERNS)
141
158
-**Error handling**: 🚨 REQUIRED - Use try-catch blocks and handle errors gracefully
142
159
-**Array destructuring**: Use object notation `{ 0: key, 1: data }` instead of array destructuring `[key, data]`
143
-
-**Comment periods**: 🚨 MANDATORY - ALL comments MUST end with periods. This includes single-line comments, multi-line comments, and inline comments. No exceptions.
144
-
-**Comment placement**: Place comments on their own line, not to the right of code
145
-
-**Comment formatting**: Use fewer hyphens/dashes and prefer commas, colons, or semicolons for better readability
160
+
-**Comment formatting**: 🚨 MANDATORY - ALL comments MUST follow these rules:
161
+
-**Periods required**: Every comment MUST end with a period, except ESLint disable comments and URLs which are directives/references. This includes single-line, multi-line, inline, and c8 ignore comments.
162
+
-**Sentence structure**: Comments should be complete sentences with proper capitalization and grammar.
163
+
-**Placement**: Place comments on their own line above the code they describe, not trailing to the right of code.
164
+
-**Style**: Use fewer hyphens/dashes and prefer commas, colons, or semicolons for better readability.
165
+
-**Examples**:
166
+
- ✅ CORRECT: `// This function validates user input.`
167
+
- ✅ CORRECT: `/* This is a multi-line comment that explains the complex logic below. */`
168
+
- ✅ CORRECT: `// eslint-disable-next-line no-await-in-loop` (directive, no period)
169
+
- ✅ CORRECT: `// See https://example.com/docs` (URL reference, no period)
170
+
- ✅ CORRECT: `// c8 ignore start - Reason for ignoring.` (explanation has period)
171
+
- ❌ WRONG: `// this validates input` (no period, not capitalized)
172
+
- ❌ WRONG: `const x = 5 // some value` (trailing comment)
146
173
-**Sorting**: 🚨 MANDATORY - Always sort lists, exports, and items alphabetically for consistency
147
174
-**Await in loops**: When using `await` inside for-loops, add `// eslint-disable-next-line no-await-in-loop` when sequential processing is intentional
148
175
-**If statement returns**: Never use single-line return if statements; always use proper block syntax with braces
0 commit comments