mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 19:50:42 +08:00
27 lines
1.0 KiB
Markdown
27 lines
1.0 KiB
Markdown
|
|
---
|
||
|
|
description: No node -e - use replace_in_file or write_to_file only
|
||
|
|
paths:
|
||
|
|
- "force-app/main/default/webapplications/**/*"
|
||
|
|
---
|
||
|
|
|
||
|
|
# A4D Enforcement: No node -e
|
||
|
|
|
||
|
|
This project forbids using "node -e" for any operation (file manipulation, string replacement, reading/writing configs, shell automation).
|
||
|
|
|
||
|
|
Policy:
|
||
|
|
- Never use "node -e" one-liners.
|
||
|
|
- Use replace_in_file or write_to_file for code/config edits.
|
||
|
|
- Use jq/sed/awk cautiously when needed; prefer replace_in_file for deterministic edits.
|
||
|
|
- For JSON edits: prefer write_to_file after reading, or replace_in_file with precise diffs.
|
||
|
|
- For ESLint/TS config changes: edit files directly via write_to_file or replace_in_file.
|
||
|
|
|
||
|
|
Rationale:
|
||
|
|
- Ensures reproducibility and auditability.
|
||
|
|
- Avoids shell escaping bugs and cross-platform inconsistencies.
|
||
|
|
- Aligns with project reliability protocol.
|
||
|
|
|
||
|
|
Violation handling:
|
||
|
|
- If any prior step used "node -e", revert and redo using write_to_file or replace_in_file.
|
||
|
|
|
||
|
|
**Cross-reference:** This rule is also summarized in **webapp.md** (MUST FOLLOW #1). Both apply.
|