Question 210
Tests use different package directories but all names end in .test.ts. How should Claude Code's path-scoped convention be corrected?
Explanation
Correct Answer
File-extension or suffix globs can match test files distributed among packages regardless of their parent directory. A hard-coded package path will miss valid tests elsewhere; project-wide TypeScript matching instead over-applies test-only guidance. By contrast, other packages with the same extension remain uncovered. Tests under another package path remain invisible even though they end in the expected suffix. Production modules would receive test-only conventions. Every production TypeScript file would receive assertions and fixture guidance irrelevant to its behavior.
Incorrect Answers
Other packages with the same extension remain uncovered. Tests under another package path remain invisible even though they end in the expected suffix. Tests use different package directories but all names end in .test.ts. Instead, use a matching file-type glob in frontmatter rather than one directory rule.
The test rule should activate from matching file paths. An absent manual command leaves an otherwise matching test file unprotected by style guidance. Tests use different package directories but all names end in .test.ts. Instead, use a matching file-type glob in frontmatter rather than one directory rule.
Production modules would receive test-only conventions. Every production TypeScript file would receive assertions and fixture guidance irrelevant to its behavior. Tests use different package directories but all names end in .test.ts. Instead, use a matching file-type glob in frontmatter rather than one directory rule.