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
feat(sfcc): validate */ and ~/ require paths against filesystem existence
extend sfcc/valid-require-path with optional existence checks for */ and ~/
add optional cartridgePath ordering for */ resolution
extend tests for valid/invalid star and tilde references
update README docs for the new options
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ The new `sfcc` plugin contains the general Rhino/SFCC runtime rules:
83
83
|`sfcc/prefer-const`| Requires `const` for `let` declarations that are never reassigned, excluding Rhino-sensitive nested/loop contexts. |`error`|
84
84
|`sfcc/rhino-const-compat`| Enforces `let` instead of `const` in Rhino loop-critical contexts (loop headers and declarations inside loop bodies) and supports auto-fix. |`error`|
85
85
|`sfcc/rhino-const-conflict`| Detects same-name `const` declarations in nested blocks within the same function (Rhino treats them as function-scoped) and supports auto-fix to `let`. |`error`|
|`sfcc/valid-require-path`| Validates SFCC-compatible `require()` paths (`dw/*`, `cartridgeName/*`, `./*`, `../*`, `*/*`, `~/*`) and supports optional filesystem existence checks. |`error`|
87
87
88
88
The recommended config intentionally combines these `sfcc/*` rules so `--fix` does not bounce between conflicting suggestions: Rhino-unsafe `const` becomes `let`, while genuinely safe top-level function bindings still become `const`.
0 commit comments