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
|`sfcc/no-e4x-syntax`| Disallows JSX/E4X-like tag syntax (e.g. `<a/>`) in SFCC JavaScript to avoid parser ambiguity and unsupported runtime patterns. |`error`|
90
-
|`sfcc/no-type-annotations`| Disallows type annotation syntax in JavaScript files (e.g. `const x: string = ...`, `function y(): number {}`). Rhino/E4X may accept it, but it is invalid in standard JavaScript; use JSDoc typing instead. |`error`|
91
-
|`sfcc/prefer-const`| Requires `const` for `let` declarations that are never reassigned, excluding Rhino-sensitive nested/loop contexts. |`error`|
92
-
|`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`|
93
-
|`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`|
94
-
|`sfcc/valid-require-path`| Validates SFCC-compatible `require()` paths (`dw/*`, `cartridgeName/*`, `./*`, `../*`, `*/*`, `~/*`) and supports optional filesystem existence checks. |`error`|
|`sfcc/no-e4x-syntax`| Disallows JSX/E4X-like tag syntax (e.g. `<a/>`) in SFCC JavaScript to avoid parser ambiguity and unsupported runtime patterns. |`error`|
90
+
|`sfcc/no-type-annotations`| Disallows type annotation syntax in JavaScript files (e.g. `const x: string = ...`, `function y(): number {}`). Rhino/E4X may accept it, but it is invalid in standard JavaScript; use JSDoc typing instead. |`error`|
91
+
|`sfcc/no-rhino-import-globals`| Disallows legacy Rhino globals `importScript(...)`, `importPackage(...)`, and `importClass(...)`. Use CommonJS `require()` instead. |`error`|
92
+
|`sfcc/prefer-const`| Requires `const` for `let` declarations that are never reassigned, excluding Rhino-sensitive nested/loop contexts. |`error`|
93
+
|`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`|
94
+
|`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`|
95
+
|`sfcc/valid-require-path`| Validates SFCC-compatible `require()` paths (`dw/*`, `cartridgeName/*`, `./*`, `../*`, `*/*`, `~/*`) and supports optional filesystem existence checks. |`error`|
95
96
96
97
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`.
97
98
@@ -210,6 +211,10 @@ Q: Are type annotations allowed in `.js` files?
210
211
211
212
A: No. `sfcc/no-type-annotations` reports annotation syntax in JavaScript files (for example `const x: string = "foo"` or `function y(): number {}`). Rhino/E4X may accept this syntax, but `.js` here follows standard JavaScript where it is invalid. Use JSDoc types instead.
212
213
214
+
Q: Are legacy Rhino import globals allowed?
215
+
216
+
A: No. `sfcc/no-rhino-import-globals` reports `importScript(...)`, `importPackage(...)`, and `importClass(...)` and points you to CommonJS `require()` instead.
217
+
213
218
Q: What suggestion is shown for multiline static markup?
214
219
215
220
A: For static multiline JSX/E4X-like markup, `sfcc/no-e4x-syntax` suggests converting to `XML(\`...\`)`. For dynamic markup (for example with `{value}`), no conversion suggestion is offered.
0 commit comments