Skip to content

Commit 4e40891

Browse files
authored
docs(claude): always existsSync for file existence (#594)
Add shared-standards rule: use existsSync from node:fs. Forbid fs.access, fs.stat-for-existence, and async fileExists wrappers. Canonical import form: `import { existsSync, promises as fs } from 'node:fs'`.
1 parent 7797383 commit 4e40891

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Backward Compatibility: 🚨 FORBIDDEN to maintain - actively remove when encountered (see canonical CLAUDE.md)
2323
- 🚨 **NEVER use `npx`, `pnpm dlx`, or `yarn dlx`** — use `pnpm exec <package>` for devDep binaries, or `pnpm run <script>` for package.json scripts. If a tool is needed, add it as a pinned devDependency first.
2424
- **minimumReleaseAge**: NEVER add packages to `minimumReleaseAgeExclude` in CI. Locally, ASK before adding — the age threshold is a security control.
25+
- File existence: ALWAYS `existsSync` from `node:fs`. NEVER `fs.access`, `fs.stat`-for-existence, or an async `fileExists` wrapper. Import form: `import { existsSync, promises as fs } from 'node:fs'`.
2526

2627
---
2728

0 commit comments

Comments
 (0)