eslint-plugin-sfmc 5.4.4 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@ Unified ESLint plugin for **Salesforce Marketing Cloud** — linting rules for b
8
8
  npm install eslint-plugin-sfmc --save-dev
9
9
  ```
10
10
 
11
- Requires ESLint **10.0.0+** (flat config) and Node.js **22+**. The ESLint minimum is a breaking requirement change; all 12 public configuration shapes remain unchanged (six objects and six multi-config arrays). Optional composition with `eslint-plugin-unicorn@76` requires ESLint **10.4.0+**, matching Unicorn 76's upstream peer range; the base SFMC plugin and its non-Unicorn configs remain supported from ESLint 10.0.0.
11
+ Requires ESLint **10.0.0+** (flat config) and Node.js **22+**. The ESLint minimum is a breaking requirement change; all 12 public configuration shapes remain unchanged (six objects and six multi-config arrays). Optional composition with `eslint-plugin-unicorn@76` or `@80` requires ESLint **10.4.0+**, matching their upstream peer range (unicorn 80 also needs Node.js **22.13+**); the base SFMC plugin and its non-Unicorn configs remain supported from ESLint 10.0.0.
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -202,9 +202,11 @@ Severities above are the same in `embedded`, `strict`, `embedded-next`, and `str
202
202
 
203
203
  [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn) is a high-quality, widely used plugin that we **strongly recommend** — but it is built for modern JavaScript, not SFMC's **SSJS** runtime. SFMC SSJS runs on a JINT-based ES3/ES5-era engine that lacks many built-ins (`Array#includes`, `String#startsWith`, `Set`, `Map`, `Math.trunc`, spread `...`, ES modules, `async`/`await`, …). CloudPage probes found zero-argument string `slice()` throwing after a working `"Hello".substring()` call. Native `Object.fromEntries`, `toReversed`, `toSorted`, `toSpliced`, `replaceAll`, `matchAll` and `structuredClone` were unavailable: `typeof` returned `undefined` and direct calls threw, both without Core and with Core 1.1.1 or 1.1.5.
204
204
 
205
- For Unicorn **76.0.0**, the SSJS compatibility overrides disable **60** of its **315** enabled recommended rules: API/syntax incompatibilities, recorded runtime-semantic hazards, and diagnostic-only pressure toward unsafe changes. Some paths are conditionally inert under strict ES5 parsing. The other **255** remain active; this classification is not a blanket runtime-safety guarantee or new live SFMC verification.
205
+ For Unicorn **80.0.0**, **83** of its **340** enabled recommended rules must not run on SSJS: API/syntax incompatibilities, recorded runtime-semantic hazards, and diagnostic-only pressure toward unsafe changes. The other **257** were audited as safe for SSJS; this is not a blanket runtime-safety guarantee. The v80 audit also found 19 rules whose fixes or suggestions were already unsafe in v76 — 15 unchanged, 4 reaching more code in v80 (for example `value ||= "none"`, `1_133_955`, `"\u{E9}"`, `replaceAll`, arrow functions); they are off for both versions.
206
206
 
207
- **Unicorn is optional; Unicorn 76 composition is upstream-supported on ESLint 10.4.0+, while the base SFMC plugin supports ESLint 10.0.0+.** The higher integration floor comes from `eslint-plugin-unicorn@76`'s declared ESLint peer range and does not raise `eslint-plugin-sfmc`'s package-wide peer minimum. When you enable Unicorn, the matching SSJS protections are required. Include `unicorn-ssjs` when Unicorn covers standalone SSJS and `unicorn-ssjs-embedded` when it covers embedded SSJS. The example below covers both scopes, so both overrides are required. `eslint-plugin-sfmc` does **not** depend on or load unicorn. The override configs are plain rules objects with **no** `plugins` key, so they only resolve when your own unicorn config (which registers the `unicorn` plugin) is loaded **earlier** in the flat-config array. Insert each sfmc override **object** directly **after** it; only the `recommended` and `embedded` arrays are spread:
207
+ **Supported unicorn versions: `>=57.0.0 <=80.0.0`** (optional peer dependency). 57.0.0 is the first ESM-only, flat-config-only unicorn. The ceiling is exactly the newest audited version: every unicorn release, patches included, can change what an autofix writes, so it is audited before `eslint-plugin-sfmc` allows it. Unicorn 76 and 80 were audited rule by rule; 77–79 are covered by the 76 → 80 comparison, and 57–75 were not audited. Unicorn 66 and later require ESLint **10.4.0+**; the base SFMC plugin supports ESLint 10.0.0+.
208
+
209
+ Add your unicorn config, then spread `sfmc.unicornSsjs(eslintPluginUnicorn)` **after** it. For standalone `.ssjs` files and SSJS embedded in HTML, it turns off every unicorn rule that no audit marked safe — including rules a newer unicorn adds or renames, and rules you enabled yourself. The audited rules keep whatever your unicorn config sets. Pass the same unicorn object your config uses.
208
210
 
209
211
  ```js
210
212
  import sfmc from 'eslint-plugin-sfmc';
@@ -218,19 +220,13 @@ export default [
218
220
  },
219
221
  ...sfmc.configs.recommended,
220
222
  ...sfmc.configs.embedded, // AMPscript + SSJS embedded in HTML (<script runat="server">)
221
- sfmc.configs['unicorn-ssjs'], // REQUIRED: protect standalone SSJS from the 60 incompatible rules
222
- sfmc.configs['unicorn-ssjs-embedded'], // REQUIRED: protect SSJS embedded in HTML
223
+ ...sfmc.unicornSsjs(eslintPluginUnicorn), // REQUIRED: only audited unicorn rules run on SSJS
223
224
  ];
224
225
  ```
225
226
 
226
- | Config | Files | What it does |
227
- | --------------------------------------- | ---------------- | --------------------------------------------------------- |
228
- | `sfmc.configs['unicorn-ssjs']` | `**/*.ssjs` | Turns off the 60 SFMC-incompatible unicorn rules for SSJS |
229
- | `sfmc.configs['unicorn-ssjs-embedded']` | `**/*.html/*.js` | Same 60-rule override for SSJS embedded in HTML |
230
-
231
227
  Scope the complete Unicorn preset to JavaScript/SSJS, not custom AMPscript, Handlebars or MSO ASTs. Clearing its builtin map prevents modern globals leaking into SSJS; other matching configs can still supply globals. The SFMC presets do not enable general `no-undef` checking, and extracted HTML server blocks are linted independently.
232
228
 
233
- Only **60** of unicorn's 315 enabled recommended rules are overridden — the other **255** stay active. If you don't use unicorn, omit these configs entirely. For the full rule-by-rule breakdown (with rationale and SFMC evidence links, pinned to unicorn v76.0.0), see [docs/unicorn-compatibility.md](docs/unicorn-compatibility.md).
229
+ The earlier setup still works: `sfmc.configs['unicorn-ssjs']` (`**/*.ssjs`) and `sfmc.configs['unicorn-ssjs-embedded']` (`**/*.html/*.js`) turn off exactly the 83 rules, but leave any rule outside the audits on. If you don't use unicorn, omit all of these. For the full rule-by-rule breakdown (with rationale and SFMC evidence links), see [docs/unicorn-compatibility.md](docs/unicorn-compatibility.md).
234
230
 
235
231
  ## Processors
236
232
 
@@ -1,23 +1,23 @@
1
1
  # `eslint-plugin-unicorn` compatibility with SFMC SSJS
2
2
 
3
- > **Compatibility analysis for [`eslint-plugin-unicorn@76.0.0`](https://github.com/sindresorhus/eslint-plugin-unicorn).**
3
+ > **Compatibility analysis for [`eslint-plugin-unicorn@80.0.0`](https://github.com/sindresorhus/eslint-plugin-unicorn), re-audited from the v76.0.0 baseline. Both 76 and 80 are supported.**
4
4
  >
5
- > ⚠️ **Version warning:** This classification was done against `eslint-plugin-unicorn` **v76.0.0** (315 enabled recommended rules). Newer versions of unicorn may add, rename, or change rules that are **not** yet classified here. Re-audit this page whenever you upgrade unicorn — a rule added in a later version could autofix SSJS into runtime-breaking code without being in the override list below.
5
+ > ⚠️ **Version warning:** This classification covers `eslint-plugin-unicorn` **v76.0.0** (315 enabled recommended rules) and **v80.0.0** (340). `eslint-plugin-sfmc` declares the optional peer range `>=57.0.0 <=80.0.0`: the ceiling is exactly the newest audited version, because any unicorn release, patches included, can change what an autofix writes. `sfmc.unicornSsjs()` turns off every rule that is not audited, so a renamed or new rule cannot slip through; changed behaviour of an audited rule still needs a re-audit. Unicorn 77–79 are covered by the 76 → 80 comparison, and 57–75 were not audited (their rule names match the 76 audit, but their fixes were not checked). The per-version verdicts live in `audit/unicorn/<version>.json` in the repository, and the test suite fails until an installed unicorn version has its own audit file.
6
6
 
7
7
  `eslint-plugin-unicorn` is an excellent, actively maintained plugin that we **strongly recommend** — but it targets modern JavaScript engines, not the Salesforce Marketing Cloud **SSJS** runtime. SFMC SSJS runs on a JINT-based ES3/ES5-era engine that is missing many built-ins (`Array#includes`, `String#startsWith`, `Set`, `Map`, `Math.trunc`, spread `...`, ES modules, `async`/`await`, …). CloudPage probes also found native `Object.fromEntries`, `matchAll` and `structuredClone` unavailable, both without Core and with Core 1.1.1 or 1.1.5. See the SFMC evidence pages:
8
8
 
9
9
  - **ECMAScript built-ins support** — <https://ssjs.guide/ecmascript-builtins/>
10
10
  - **Engine limitations** — <https://ssjs.guide/engine-limitations/>
11
11
 
12
- Of unicorn's **315** enabled recommended rules (v76.0.0), **255** remain active (including conditional and inert cases; not a blanket runtime-safety guarantee) and **60** should be turned off. `eslint-plugin-sfmc` ships a scope-specific override config (`unicorn-ssjs` / `unicorn-ssjs-embedded`) that turns off exactly those 60 for SSJS files. `eslint-plugin-sfmc` does **not** depend on or load unicorn — the override only takes effect when you have loaded unicorn yourself. See [Section 1](#section-1--how-to-apply).
12
+ Of unicorn's **340** enabled recommended rules (v80.0.0), **257** remain active (including conditional and inert cases; not a blanket runtime-safety guarantee) and **83** must be turned off. `sfmc.unicornSsjs(unicorn)` keeps only the audited rules for SSJS files and turns every other unicorn rule off; the older override configs (`unicorn-ssjs` / `unicorn-ssjs-embedded`) turn off exactly those 83. `eslint-plugin-sfmc` does **not** depend on or load unicorn — you pass in the unicorn plugin you already use. See [Section 1](#section-1--how-to-apply).
13
13
 
14
14
  ---
15
15
 
16
16
  ## Section 1 — How to apply
17
17
 
18
- The base `eslint-plugin-sfmc` package requires ESLint **10.0.0+** and Node.js **22+**. Optional composition with `eslint-plugin-unicorn@76` is upstream-supported only on ESLint **10.4.0+**, because Unicorn 76 declares that ESLint peer range. This integration floor does not raise the package-wide SFMC peer minimum: consumers that do not compose Unicorn remain supported from ESLint 10.0.0.
18
+ The base `eslint-plugin-sfmc` package requires ESLint **10.0.0+** and Node.js **22+**. Unicorn is an optional peer dependency in the range `>=57.0.0 <=80.0.0`. Unicorn 66 and later declare ESLint **10.4.0+**, and unicorn 80 additionally requires Node.js **22.13+**; this does not raise the SFMC peer minimum for projects without unicorn.
19
19
 
20
- Unicorn itself is **optional**. When you enable it for standalone SSJS, `unicorn-ssjs` is **required**; when you enable it for embedded SSJS, `unicorn-ssjs-embedded` is **required**. The example below covers both scopes, so it requires both overrides. `eslint-plugin-sfmc` never loads unicorn; the override is a plain rules object that only resolves when you have loaded your own unicorn config **earlier** in the flat-config array (that config registers the `unicorn` plugin). Insert each sfmc override **object** directly **after** it; only the `recommended` and `embedded` arrays are spread:
20
+ Add your unicorn config, then spread `sfmc.unicornSsjs(eslintPluginUnicorn)` **after** it:
21
21
 
22
22
  ```js
23
23
  import sfmc from 'eslint-plugin-sfmc';
@@ -30,24 +30,39 @@ export default [
30
30
  languageOptions: { ...eslintPluginUnicorn.configs.recommended.languageOptions, globals: {} },
31
31
  },
32
32
  ...sfmc.configs.recommended,
33
- ...sfmc.configs.embedded, // AMPscript + SSJS embedded in HTML (<script runat="server">)
34
- sfmc.configs['unicorn-ssjs'], // REQUIRED: protect standalone SSJS from the 60 incompatible rules
35
- sfmc.configs['unicorn-ssjs-embedded'], // REQUIRED: protect SSJS embedded in HTML
33
+ ...sfmc.configs.embedded, // AMPscript + SSJS embedded in HTML (<script runat="server">)
34
+ ...sfmc.unicornSsjs(eslintPluginUnicorn), // REQUIRED: only audited unicorn rules run on SSJS
36
35
  ];
37
36
  ```
38
37
 
38
+ What `sfmc.unicornSsjs(unicorn)` returns: one config for `**/*.ssjs` and `**/*.html/*.js` (SSJS extracted from `<script runat="server">`) that registers the unicorn object you pass and sets every unicorn rule to `off` except the 257 audited as safe (Section 3). Those keep whatever your own unicorn config sets, including rules you turned off or configured. Rules outside the audits are off on SSJS even when you enabled them yourself; that is deliberate, so a new or renamed rule cannot reach SSJS before it is audited. Because it only ever writes `off`, it never fails on a unicorn version that lacks a rule.
39
+
39
40
  Keep the full recommended rule set, but scope it to JavaScript and SSJS (including extracted HTML JavaScript). AMPscript, Handlebars and MSO use custom ASTs that JavaScript-only Unicorn visitors cannot traverse safely. Replace Unicorn's builtin globals within this copied preset with an empty map so the language/runtime configs own globals; this does not remove globals from other matching config entries. The SFMC presets do not enable general `no-undef` checking, and separate HTML server blocks are linted independently.
40
41
 
42
+ ### Earlier setup: the two override configs
43
+
44
+ The override configs still work. They turn off exactly the 83 rules of Section 2 but leave every rule outside the audits on, so they protect less than `unicornSsjs()`. They are plain rules objects without a `plugins` key; insert each directly **after** your unicorn config:
45
+
41
46
  | Config | Applies to |
42
47
  |---|---|
43
48
  | `unicorn-ssjs` | `**/*.ssjs` |
44
49
  | `unicorn-ssjs-embedded` | `**/*.html/*.js` (SSJS extracted from `<script runat="server">`) |
45
50
 
46
- If you don't use unicorn, omit these configs entirely — nothing else in `eslint-plugin-sfmc` references them.
51
+ ```js
52
+ export default [
53
+ { ...eslintPluginUnicorn.configs.recommended, files: ['**/*.{js,mjs,cjs,ssjs}'] },
54
+ ...sfmc.configs.recommended,
55
+ ...sfmc.configs.embedded,
56
+ sfmc.configs['unicorn-ssjs'],
57
+ sfmc.configs['unicorn-ssjs-embedded'],
58
+ ];
59
+ ```
47
60
 
48
- All 12 public shapes remain unchanged: six objects (`ampscript`, `ssjs`, `ampscript-next`, `ssjs-next`, `unicorn-ssjs`, `unicorn-ssjs-embedded`) and six arrays (`recommended`, `embedded`, `strict`, `recommended-next`, `embedded-next`, `strict-next`). Raw arrays require spreading the multi-config presets as above, not the single override objects.
61
+ If you don't use unicorn, omit all of these — nothing else in `eslint-plugin-sfmc` references them.
49
62
 
50
- Alternatively, ESLint's `defineConfig` flattens nested configuration arrays. The base SFMC presets are verified at exactly ESLint **10.0.0** and at **10.11.0**. The Unicorn composition shown here is tested only on an engine satisfying Unicorn 76's upstream floor (**10.4.0+**); it is not presented as supported on ESLint 10.0–10.3:
63
+ All 12 public config shapes remain unchanged: six objects (`ampscript`, `ssjs`, `ampscript-next`, `ssjs-next`, `unicorn-ssjs`, `unicorn-ssjs-embedded`) and six arrays (`recommended`, `embedded`, `strict`, `recommended-next`, `embedded-next`, `strict-next`). `unicornSsjs` is a function on the plugin, not one of the configs.
64
+
65
+ Alternatively, ESLint's `defineConfig` flattens nested configuration arrays:
51
66
 
52
67
  ```js
53
68
  import { defineConfig } from 'eslint/config';
@@ -62,18 +77,17 @@ export default defineConfig(
62
77
  },
63
78
  sfmc.configs.recommended,
64
79
  sfmc.configs.embedded,
65
- sfmc.configs['unicorn-ssjs'],
66
- sfmc.configs['unicorn-ssjs-embedded'],
80
+ sfmc.unicornSsjs(eslintPluginUnicorn),
67
81
  );
68
82
  ```
69
83
 
70
84
  ---
71
85
 
72
- ## Section 2 — Rules to override for SSJS (60)
86
+ ## Section 2 — Rules to override for SSJS (83)
73
87
 
74
- These 60 recommended rules introduce unavailable or unresolved APIs, conflict with recorded runtime semantics, pressure users toward unsafe changes through diagnostics, or introduce unsupported syntax. Some paths are conditionally inert under strict ES5 parsing. The override config sets each to `'off'` for SSJS. All 60 are confirmed enabled in unicorn v76.0.0's recommended configuration.
88
+ These 83 recommended rules introduce unavailable or unresolved APIs, conflict with recorded runtime semantics, pressure users toward unsafe changes through diagnostics, or introduce unsupported syntax. Some paths are conditionally inert under strict ES5 parsing. The override config sets each to `'off'` for SSJS. All 83 are enabled in unicorn v80.0.0's recommended configuration. Rows marked **(80 audit)** were added by the v80 re-audit; "since 76" means the same behaviour already existed in v76 and was missed by the v76 classification.
75
89
 
76
- ### Group A — API, runtime-semantic and diagnostic protections (52)
90
+ ### Group A — API, runtime-semantic and diagnostic protections (63)
77
91
 
78
92
  | Rule | Why it breaks SSJS | SFMC evidence |
79
93
  |---|---|---|
@@ -129,8 +143,19 @@ These 60 recommended rules introduce unavailable or unresolved APIs, conflict wi
129
143
  | [`no-redundant-comparison`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-redundant-comparison.md) | With the numeric equality gate `x === y && x > Number.MIN_VALUE && y > 0`, an editor suggestion removes `y > 0`; recorded negative `MIN_VALUE` invalidates the host-derived implication | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
130
144
  | [`no-impossible-length-comparison`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-impossible-length-comparison.md) | Diagnostic-only length comparison reasoning assumes the host's positive `Number.MIN_VALUE`, contrary to the recorded negative SSJS value | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
131
145
  | [`no-useless-coercion`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-coercion.md) | Autofix removes required coercion from `Number(Number.MIN_VALUE > 0 ? 1 : 'x')`; host evaluation selects a number, while recorded SSJS selects a string | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
132
-
133
- ### Group B — introduce or require ES6+ syntax / ES-module / async constructs (8)
146
+ | [`consistent-date-clone`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-date-clone.md) | **(80 audit, since 76)** Autofix turns `new Date(d.getTime())` into `new Date(d)`. In SSJS `new Date(d)` drops the milliseconds (verified live: `…123` becomes `…000`), while `new Date(d.getTime())` keeps them. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
147
+ | [`no-array-method-this-argument`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md) | **(80 audit, since 76)** Its second suggestion rewrites `arr.map(fn, ctx)` to `arr.map(fn.bind(ctx))`. `Function.prototype.bind` is unavailable in SSJS (the prototype is sealed; ssjs-data offers a standalone helper instead). | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
148
+ | [`no-computed-property-existence-check`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-computed-property-existence-check.md) | **(80 audit, since 76)** On plain objects (`key in map`, `map[key] !== undefined`) its suggestion is `Object.hasOwn(map, key)`, which does not exist in SSJS (verified live: `typeof` is `undefined`, the call throws). 80 skips Map/Set receivers but not plain objects. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
149
+ | [`dom-node-dataset`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/dom-node-dataset.md) | **(80 audit, since 76)** Autofix rewrites `el.hasAttribute('data-x')` to `Object.hasOwn(el.dataset, 'x')`, which throws in SSJS (`Object.hasOwn` does not exist; found by the live probe database). SSJS has no DOM, so the `setAttribute`/`removeAttribute` → `.dataset` fixes also bypass the methods of the user's own object. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
150
+ | [`no-useless-undefined`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md) | **(80 audit, since 76)** Autofix drops trailing `undefined` arguments, e.g. `Platform.Function.Lookup("de", "v", "k", undefined)` → a 3-argument call. SFMC platform functions and Core methods are bound by argument count (see the arity catalog in ssjs-data), so removing the argument changes which overload runs or makes the call invalid. 80 narrows the variable-initializer branch but keeps the argument branch. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
151
+ | [`prefer-https`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-https.md) | **(80 audit, since 76)** Autofix rewrites every `http://` string, including XML namespace identifiers such as the SOAP namespace `http://exacttarget.com/wsdl/partnerAPI` used in hand-built SFMC SOAP envelopes. A namespace URI is an identifier, not a URL; changing it breaks the request (verified live: a SOAP Retrieve with the https namespace returns `OverallStatus` `Error` and no results). | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
152
+ | [`prefer-literal-ascii`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-literal-ascii.md) | **(80 audit, new in 80)** Autofix unescapes `\x3C/script>` to `</script>` and `\x25%=…=%\x25` to `%%=…=%%`. SSJS runs inside `<script runat="server">` (CloudPages, and mcdev deploys `.ssjs` into such blocks), so the literal text closes the block early or is evaluated as AMPscript; the escapes are deliberate. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
153
+ | [`prefer-object-iterable-methods`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-iterable-methods.md) | **(80 audit, since 76)** Autofix rewrites `Object.keys(o).map(function (k) { return o[k]; })` to `Object.values(o)` (and to `Object.entries` with a destructured `[key, value]` parameter when the key is used). Both methods are unavailable in SSJS and destructuring is ES2015. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
154
+ | [`prefer-regexp-exec`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-exec.md) | **(80 audit, new in 80)** Autofix rewrites `str.match(re)` to `re.exec(str)`. In SSJS a no-match `match()` returns a truthy `[]` while `exec()` returns `null`, and `exec()` capture groups (`m[1]`…) are undefined — the fix changes behaviour of working code. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
155
+ | [`prefer-single-replace`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-replace.md) | **(80 audit, since 76)** Autofix merges chained single-character `.replace()` calls into native `String#replaceAll`, unavailable in CloudPage probes. 80 also fixes chains that contain comments. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
156
+ | [`prefer-url-search-parameters`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-search-parameters.md) | **(80 audit, since 76)** Fires on ordinary query-string splitting (`query.split("&")…`) and suggests `new URLSearchParams(...)`, which does not exist in SSJS (verified live: `URL` and `URLSearchParams` are `undefined`); 80 also reports the comment-containing cases. Same treatment as the diagnostic-only pressure of `prefer-includes-over-repeated-comparisons`. | [ECMAScript built-ins](https://ssjs.guide/ecmascript-builtins/) |
157
+
158
+ ### Group B — introduce or require ES6+ syntax / ES-module / async constructs (20)
134
159
 
135
160
  | Rule | Why it breaks SSJS | SFMC evidence |
136
161
  |---|---|---|
@@ -142,16 +167,51 @@ These 60 recommended rules introduce unavailable or unresolved APIs, conflict wi
142
167
  | [`prefer-node-protocol`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md) | Pushes `node:` imports — no module system | [Engine limitations](https://ssjs.guide/engine-limitations/) |
143
168
  | [`prefer-top-level-await`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md) | Pushes top-level `await` — async unsupported | [Engine limitations](https://ssjs.guide/engine-limitations/) |
144
169
  | [`prefer-export-from`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md) | Pushes `export … from` — ES modules | [Engine limitations](https://ssjs.guide/engine-limitations/) |
170
+ | [`logical-assignment-operators`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/logical-assignment-operators.md) | **(80 audit, since 76)** Autofix turns `x = x \|\| y` into ES2021 `x \|\|= y` (also `&&=`), which the ES5 engine cannot parse. The rule does not check ecmaVersion; `eslint --fix` writes the broken file. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
171
+ | [`no-accidental-bitwise-operator`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accidental-bitwise-operator.md) | **(80 audit, since 76)** For `x \|= ""` its suggestion is the ES2021 `\|\|=` operator, which the ES5 engine cannot parse. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
172
+ | [`no-array-callback-reference`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md) | **(80 audit, since 76)** Every suggestion wraps the callback in an arrow function (`.map((element) => format(element))`), ES2015 syntax, even under ES5 parsing — same pattern as `require-array-sort-compare`. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
173
+ | [`no-array-sort-for-min-max`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort-for-min-max.md) | **(80 audit, since 76)** Editor suggestion replaces `arr.sort(...)[0]` with spread `Math.min(...arr)`, ES2015 syntax. 80 also suggests it when comments are present. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
174
+ | [`no-boolean-sort-comparator`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-boolean-sort-comparator.md) | **(80 audit, since 76)** Its suggestion replaces a boolean-returning comparator with the arrow function `(a, b) => a - b`, ES2015 syntax. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
175
+ | [`no-immediate-mutation`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-immediate-mutation.md) | **(80 audit, since 76)** Autofix folds `var o = {}; o["a"] = 1;` into an ES2015 computed key `{ ["a"]: 1 }`, which the ES5 engine cannot parse. 80 adds declaration+assignment merging and `checkCollections` (default on), widening the rule. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
176
+ | [`no-xor-as-exponentiation`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-xor-as-exponentiation.md) | **(80 audit, since 76)** Its only suggestion replaces `^` with the ES2016 `**` operator, which the ES5 engine cannot parse; the diagnostic pushes toward that syntax. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
177
+ | [`numeric-separators-style`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md) | **(80 audit, since 76)** Autofix inserts ES2021 numeric separators (`1133955` → `1_133_955`, `0xFFFFFF` → `0xFF_FF_FF`), which the ES5 engine cannot parse. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
178
+ | [`prefer-escaped-irregular-whitespace`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-escaped-irregular-whitespace.md) | **(80 audit, new in 80)** Autofix always writes ES2015 code-point escapes (`\u{A0}`, `\u{FEFF}`) regardless of ecmaVersion; the fixed file no longer parses as ES5. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
179
+ | [`prefer-logical-operator-over-ternary`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md) | **(80 audit, since 76)** Editor suggestions emit ES2020 `??` (and `?.`) for plain ES5 ternaries such as `value ? value : "none"`; 80 adds more cases. Not ES5 syntax. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
180
+ | [`prefer-simple-sort-comparator`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-sort-comparator.md) | **(80 audit, since 76)** Its suggestion replaces an if/return comparator with the arrow function `(a, b) => a - b`, ES2015 syntax. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
181
+ | [`prefer-unicode-code-point-escapes`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-unicode-code-point-escapes.md) | **(80 audit, since 76)** Autofix rewrites `\u00e9` to ES2015 code-point escape `\u{E9}` (and regex escapes with the `u` flag); not ES5 syntax. 80 skips only printable-ASCII and short escapes. | [Engine limitations](https://ssjs.guide/engine-limitations/) |
145
182
 
146
183
  > **Regex caution:** Availability of `RegExp#test` does not establish equivalence with `.match()` or `.search()`. Recorded SSJS no-match arrays, zero-result search behavior and conflicting global-regex state evidence must be checked against the actual transformation predicate.
147
184
 
148
185
  ---
149
186
 
150
- ## Section 3 — Active rules, including conditional cases (255)
187
+ ## Unicorn 76 → 80 audit (2026-11-29)
188
+
189
+ Every rule in v80's recommended set was compared with v76: the rule source and the shared helpers it imports, its meta (fixable, suggestions, schema, defaults), and the release notes for 77.0.0–80.0.0. A differential lint harness then ran v76 and v80 over ES5 SSJS — the plugin's fixtures, the ssjs.guide examples, mcdev-ssjs-validation scripts and targeted inputs for every fix and suggestion branch reachable from ES5 — and re-parsed every fix and suggestion result as ES5. Built-in availability was taken from ssjs-data, not from general JavaScript knowledge.
190
+
191
+ | Classification | Rules | Verdict |
192
+ |---|---|---|
193
+ | Unchanged for JavaScript (refactor, non-JS languages, TypeScript or ES2015+-gated paths) | 123 | active |
194
+ | Changed, still safe (ES5-reachable output stays ES5, no new built-ins) | 111 | active |
195
+ | Changed for the worse — the unsafe output existed in 76 and 80 reaches more code | 4 | **off** |
196
+ | Unchanged but unsafe — already emitted the same unsafe output in 76 (missed by the 76 audit) | 16 | **off** |
197
+ | New in 80's recommended set | 26 | 3 off, 23 active |
198
+ | Already off since 76 | 60 | off |
199
+ | Removed from the recommended set | 1 (`no-async-promise-finally`) | — |
200
+
201
+ - **Changed for the worse:** `no-array-sort-for-min-max`, `no-immediate-mutation`, `prefer-single-replace`, `prefer-url-search-parameters`. Their v76 fixes or suggestions already emitted `replaceAll`, spread, computed keys or `URLSearchParams`; v80 now also reports and fixes code that contains comments, and `no-immediate-mutation` merges declarations with the following assignment.
202
+ - **Unsafe since 76:** `consistent-date-clone`, `dom-node-dataset`, `logical-assignment-operators`, `no-accidental-bitwise-operator`, `no-array-callback-reference`, `no-array-method-this-argument`, `no-boolean-sort-comparator`, `no-computed-property-existence-check`, `no-useless-undefined`, `no-xor-as-exponentiation`, `numeric-separators-style`, `prefer-https`, `prefer-logical-operator-over-ternary`, `prefer-object-iterable-methods`, `prefer-simple-sort-comparator`, `prefer-unicode-code-point-escapes`. Several are autofixes, so `eslint --fix` on a `.ssjs` file wrote code such as `value ||= "none"` or `1_133_955` that the engine cannot parse — also with unicorn 76.
203
+ - **New and off:** `prefer-escaped-irregular-whitespace`, `prefer-literal-ascii`, `prefer-regexp-exec`.
204
+ - **New and active:** most new rules target browser, DOM, Fetch, Intl, Temporal, URL or Promise APIs that SSJS does not have, or need ES2015+ input. `no-leading-empty-lines` does not fire on blocks extracted from HTML. `no-asterisk-prefix-in-documentation-comments` only reformats JSDoc; turn it off yourself if you keep starred JSDoc.
205
+ - **Changed and still active, worth knowing:** since v79, type-aware rules trust JSDoc `@type`/`@param`/`@returns`, so `no-unnecessary-boolean-comparison` autofixes `ok === true` to `ok` when `ok` is annotated as boolean — annotate Platform results that are the strings `"true"`/`"false"` as strings. `text-encoding-identifier-case` suggests `"utf8"` for `"UTF-8"`; do not accept that for SFMC charset arguments.
206
+ - **`no-new-array`** became safer in v80 (diagnostic only for the inferred-length case) but stays off: v76 still autofixes to `Array.from` and the v80 message points to it.
207
+
208
+ ---
209
+
210
+ ## Section 3 — Active rules, including conditional cases (257)
151
211
 
152
212
  These recommended rules are **not** disabled by the override config. Active is a policy classification, not proof that every transformation is safe in SFMC. Modern-syntax-gated paths may be inert under strict ES5 parsing; DOM, Node.js, TypeScript and custom/polyfilled-object paths require their own environment contracts. Each links to its official Unicorn documentation. See the evidence qualifications below before accepting generated changes.
153
213
 
154
- <!-- BEGIN 255-OK-LIST -->
214
+ <!-- BEGIN ACTIVE-LIST -->
155
215
  - [better-dom-traversing](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-dom-traversing.md)
156
216
  - [catch-error-name](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md)
157
217
  - [class-reference-in-static-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/class-reference-in-static-methods.md)
@@ -160,7 +220,6 @@ These recommended rules are **not** disabled by the override config. Active is a
160
220
  - [consistent-class-member-order](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-class-member-order.md)
161
221
  - [consistent-compound-words](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-compound-words.md)
162
222
  - [consistent-conditional-object-spread](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-conditional-object-spread.md)
163
- - [consistent-date-clone](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-date-clone.md)
164
223
  - [consistent-empty-array-spread](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md)
165
224
  - [consistent-existence-index-check](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md)
166
225
  - [consistent-export-decorator-position](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-export-decorator-position.md)
@@ -170,7 +229,6 @@ These recommended rules are **not** disabled by the override config. Active is a
170
229
  - [consistent-template-literal-escape](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-template-literal-escape.md)
171
230
  - [consistent-tuple-labels](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-tuple-labels.md)
172
231
  - [default-export-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/default-export-style.md)
173
- - [dom-node-dataset](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/dom-node-dataset.md)
174
232
  - [empty-brace-spaces](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md)
175
233
  - [error-message](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md)
176
234
  - [escape-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md)
@@ -180,32 +238,26 @@ These recommended rules are **not** disabled by the override config. Active is a
180
238
  - [filename-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md)
181
239
  - [import-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md)
182
240
  - [isolated-functions](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/isolated-functions.md)
183
- - [logical-assignment-operators](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/logical-assignment-operators.md)
184
241
  - [max-nested-calls](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/max-nested-calls.md)
185
242
  - [name-replacements](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/name-replacements.md)
186
243
  - [new-for-builtins](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md)
187
244
  - [no-abusive-eslint-disable](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md)
188
245
  - [no-accessor-recursion](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accessor-recursion.md)
189
- - [no-accidental-bitwise-operator](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accidental-bitwise-operator.md)
190
246
  - [no-anonymous-default-export](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-anonymous-default-export.md)
191
- - [no-array-callback-reference](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md)
192
247
  - [no-array-concat-in-loop](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-concat-in-loop.md)
193
248
  - [no-array-fill-with-reference-type](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-fill-with-reference-type.md)
194
249
  - [no-array-from-fill](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-from-fill.md)
195
- - [no-array-method-this-argument](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md)
196
250
  - [no-array-reduce](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md)
197
- - [no-array-sort-for-min-max](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort-for-min-max.md)
251
+ - [no-asterisk-prefix-in-documentation-comments](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-asterisk-prefix-in-documentation-comments.md)
198
252
  - [no-async-iterator-callback](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-async-iterator-callback.md)
199
- - [no-async-promise-finally](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-async-promise-finally.md)
200
253
  - [no-await-expression-member](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md)
201
254
  - [no-await-in-promise-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-in-promise-methods.md)
202
255
  - [no-blob-to-file](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-blob-to-file.md)
203
- - [no-boolean-sort-comparator](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-boolean-sort-comparator.md)
204
256
  - [no-break-in-nested-loop](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-break-in-nested-loop.md)
205
257
  - [no-canvas-to-image](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-canvas-to-image.md)
206
258
  - [no-chained-comparison](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-chained-comparison.md)
207
259
  - [no-collection-bracket-access](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-collection-bracket-access.md)
208
- - [no-computed-property-existence-check](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-computed-property-existence-check.md)
260
+ - [no-conflicting-constraints](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-conflicting-constraints.md)
209
261
  - [no-confusing-array-splice](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-confusing-array-splice.md)
210
262
  - [no-confusing-array-with](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-confusing-array-with.md)
211
263
  - [no-console-spaces](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md)
@@ -221,16 +273,27 @@ These recommended rules are **not** disabled by the override config. Active is a
221
273
  - [no-error-property-assignment](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-error-property-assignment.md)
222
274
  - [no-exports-in-scripts](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-exports-in-scripts.md)
223
275
  - [no-global-object-property-assignment](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-global-object-property-assignment.md)
224
- - [no-immediate-mutation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-immediate-mutation.md)
276
+ - [no-incomplete-accessor-override](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-incomplete-accessor-override.md)
225
277
  - [no-incorrect-query-selector](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-incorrect-query-selector.md)
226
278
  - [no-incorrect-template-string-interpolation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-incorrect-template-string-interpolation.md)
279
+ - [no-ineffective-csp-directives](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-ineffective-csp-directives.md)
227
280
  - [no-invalid-argument-count](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-argument-count.md)
281
+ - [no-invalid-boolean-attribute-value](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-boolean-attribute-value.md)
228
282
  - [no-invalid-character-comparison](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-character-comparison.md)
283
+ - [no-invalid-dom-token](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-dom-token.md)
229
284
  - [no-invalid-fetch-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md)
285
+ - [no-invalid-integrity](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-integrity.md)
286
+ - [no-invalid-intl-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-intl-options.md)
287
+ - [no-invalid-property-descriptor](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-property-descriptor.md)
230
288
  - [no-invalid-remove-event-listener](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md)
289
+ - [no-invalid-response-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-response-options.md)
290
+ - [no-invalid-style-set-property](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-style-set-property.md)
291
+ - [no-invalid-temporal-arithmetic](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-temporal-arithmetic.md)
292
+ - [no-invalid-url-protocol-comparison](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-url-protocol-comparison.md)
231
293
  - [no-invalid-well-known-symbol-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-well-known-symbol-methods.md)
232
294
  - [no-late-current-target-access](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-late-current-target-access.md)
233
295
  - [no-late-event-control](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-late-event-control.md)
296
+ - [no-leading-empty-lines](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-leading-empty-lines.md)
234
297
  - [no-lonely-if](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md)
235
298
  - [no-loop-iterable-mutation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-loop-iterable-mutation.md)
236
299
  - [no-magic-array-flat-depth](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md)
@@ -250,6 +313,7 @@ These recommended rules are **not** disabled by the override config. Active is a
250
313
  - [no-object-as-default-parameter](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-as-default-parameter.md)
251
314
  - [no-object-methods-with-collections](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-methods-with-collections.md)
252
315
  - [no-optional-chaining-on-undeclared-variable](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-optional-chaining-on-undeclared-variable.md)
316
+ - [no-prevent-default-in-passive-listener](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-prevent-default-in-passive-listener.md)
253
317
  - [no-process-exit](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md)
254
318
  - [no-return-array-push](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-return-array-push.md)
255
319
  - [no-selector-as-dom-name](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-selector-as-dom-name.md)
@@ -273,6 +337,7 @@ These recommended rules are **not** disabled by the override config. Active is a
273
337
  - [no-unnecessary-fetch-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-fetch-options.md)
274
338
  - [no-unnecessary-global-this](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-global-this.md)
275
339
  - [no-unnecessary-nested-ternary](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-nested-ternary.md)
340
+ - [no-unnecessary-parameters](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-parameters.md)
276
341
  - [no-unnecessary-polyfills](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md)
277
342
  - [no-unnecessary-slice-end](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-slice-end.md)
278
343
  - [no-unnecessary-string-trim](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-string-trim.md)
@@ -280,14 +345,15 @@ These recommended rules are **not** disabled by the override config. Active is a
280
345
  - [no-unreadable-for-of-expression](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-for-of-expression.md)
281
346
  - [no-unreadable-iife](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md)
282
347
  - [no-unreadable-object-destructuring](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-object-destructuring.md)
283
- - [no-using-resource-escape](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-using-resource-escape.md)
284
348
  - [no-unsafe-buffer-conversion](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-buffer-conversion.md)
349
+ - [no-unsafe-json-serialization](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-json-serialization.md)
285
350
  - [no-unsafe-promise-all-settled-values](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-promise-all-settled-values.md)
286
351
  - [no-unsafe-property-key](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-property-key.md)
287
352
  - [no-unsafe-sqlite-interpolation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-sqlite-interpolation.md)
288
353
  - [no-unsafe-string-replacement](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-string-replacement.md)
289
354
  - [no-unused-builtin-method-return](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-builtin-method-return.md)
290
355
  - [no-unused-iterator-helper](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-iterator-helper.md)
356
+ - [no-url-in-search-params](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-url-in-search-params.md)
291
357
  - [no-useless-boolean-cast](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-boolean-cast.md)
292
358
  - [no-useless-collection-argument](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md)
293
359
  - [no-useless-compound-assignment](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-compound-assignment.md)
@@ -304,20 +370,18 @@ These recommended rules are **not** disabled by the override config. Active is a
304
370
  - [no-useless-promise-resolve-reject](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md)
305
371
  - [no-useless-re-export](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-re-export.md)
306
372
  - [no-useless-recursion](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-recursion.md)
307
- - [no-useless-spread](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md)
308
373
  - [no-useless-set-construction](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-set-construction.md)
374
+ - [no-useless-spread](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md)
309
375
  - [no-useless-switch-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md)
310
376
  - [no-useless-template-literals](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-template-literals.md)
311
- - [no-useless-undefined](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md)
312
- - [no-xor-as-exponentiation](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-xor-as-exponentiation.md)
377
+ - [no-using-resource-escape](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-using-resource-escape.md)
313
378
  - [no-zero-fractions](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md)
314
379
  - [number-literal-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md)
315
- - [numeric-separators-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md)
316
380
  - [operator-assignment](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/operator-assignment.md)
317
381
  - [prefer-abort-signal-any](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-abort-signal-any.md)
318
382
  - [prefer-abort-signal-timeout](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-abort-signal-timeout.md)
319
- - [prefer-add-event-listener-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener-options.md)
320
383
  - [prefer-add-event-listener](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md)
384
+ - [prefer-add-event-listener-options](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener-options.md)
321
385
  - [prefer-aggregate-error](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-aggregate-error.md)
322
386
  - [prefer-array-from-map](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-from-map.md)
323
387
  - [prefer-array-from-range](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-from-range.md)
@@ -347,24 +411,23 @@ These recommended rules are **not** disabled by the override config. Active is a
347
411
  - [prefer-global-this](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md)
348
412
  - [prefer-has-check](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-has-check.md)
349
413
  - [prefer-hoisting-branch-code](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-hoisting-branch-code.md)
350
- - [prefer-https](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-https.md)
351
414
  - [prefer-identifier-import-export-specifiers](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-identifier-import-export-specifiers.md)
352
415
  - [prefer-iterable-in-constructor](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterable-in-constructor.md)
353
- - [prefer-iterator-to-array-at-end](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-to-array-at-end.md)
354
416
  - [prefer-iterator-to-array](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-to-array.md)
417
+ - [prefer-iterator-to-array-at-end](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-to-array-at-end.md)
355
418
  - [prefer-keyboard-event-key](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md)
356
419
  - [prefer-location-assign](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-location-assign.md)
357
- - [prefer-logical-operator-over-ternary](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md)
358
420
  - [prefer-math-abs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-abs.md)
359
421
  - [prefer-math-constants](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-constants.md)
360
422
  - [prefer-math-min-max](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md)
361
423
  - [prefer-minimal-ternary](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-minimal-ternary.md)
362
424
  - [prefer-modern-dom-apis](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md)
363
425
  - [prefer-object-destructuring-defaults](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-destructuring-defaults.md)
364
- - [prefer-object-iterable-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-iterable-methods.md)
365
426
  - [prefer-observer-apis](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-observer-apis.md)
427
+ - [prefer-options-parameter](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-options-parameter.md)
366
428
  - [prefer-path2d](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-path2d.md)
367
429
  - [prefer-private-class-fields](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-private-class-fields.md)
430
+ - [prefer-promise-static-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-promise-static-methods.md)
368
431
  - [prefer-promise-try](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-promise-try.md)
369
432
  - [prefer-promise-with-resolvers](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-promise-with-resolvers.md)
370
433
  - [prefer-prototype-methods](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md)
@@ -372,13 +435,12 @@ These recommended rules are **not** disabled by the override config. Active is a
372
435
  - [prefer-queue-microtask](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-queue-microtask.md)
373
436
  - [prefer-response-static-json](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-response-static-json.md)
374
437
  - [prefer-scoped-selector](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-scoped-selector.md)
438
+ - [prefer-short-escape-sequences](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-short-escape-sequences.md)
375
439
  - [prefer-simple-condition-first](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-condition-first.md)
376
- - [prefer-simple-sort-comparator](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-sort-comparator.md)
377
440
  - [prefer-simplified-conditions](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simplified-conditions.md)
378
441
  - [prefer-single-array-predicate](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-array-predicate.md)
379
442
  - [prefer-single-call](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-call.md)
380
443
  - [prefer-single-object-destructuring](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-object-destructuring.md)
381
- - [prefer-single-replace](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-replace.md)
382
444
  - [prefer-smaller-scope](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-smaller-scope.md)
383
445
  - [prefer-split-limit](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-split-limit.md)
384
446
  - [prefer-switch](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md)
@@ -388,26 +450,26 @@ These recommended rules are **not** disabled by the override config. Active is a
388
450
  - [prefer-type-error](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md)
389
451
  - [prefer-type-literal-last](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-literal-last.md)
390
452
  - [prefer-unary-minus](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-unary-minus.md)
391
- - [prefer-unicode-code-point-escapes](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-unicode-code-point-escapes.md)
392
453
  - [prefer-url-can-parse](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-can-parse.md)
393
454
  - [prefer-url-href](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-href.md)
394
- - [prefer-url-search-parameters](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-search-parameters.md)
395
455
  - [prefer-while-loop-condition](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-while-loop-condition.md)
396
456
  - [relative-url-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md)
457
+ - [require-array-join-separator](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md)
397
458
  - [require-css-escape](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-css-escape.md)
398
459
  - [require-module-attributes](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-attributes.md)
399
460
  - [require-module-specifiers](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-specifiers.md)
400
461
  - [require-number-to-fixed-digits-argument](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md)
401
462
  - [require-passive-events](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-passive-events.md)
402
463
  - [require-proxy-trap-boolean-return](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-proxy-trap-boolean-return.md)
464
+ - [require-spread-parentheses](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-spread-parentheses.md)
465
+ - [require-text-decoder-streaming](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-text-decoder-streaming.md)
403
466
  - [single-line-block-comment-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/single-line-block-comment-style.md)
404
467
  - [switch-case-braces](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md)
405
468
  - [switch-case-break-position](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-break-position.md)
406
469
  - [template-indent](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/template-indent.md)
407
470
  - [text-encoding-identifier-case](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md)
408
471
  - [throw-new-error](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md)
409
- - [require-array-join-separator](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md)
410
- <!-- END 255-OK-LIST -->
472
+ <!-- END ACTIVE-LIST -->
411
473
 
412
474
  **Reactivated, with bounded evidence:** `require-array-join-separator` adds an explicit comma separator, which recorded SSJS supports. `prefer-global-number-constants` replaces Number properties with globals: positive-infinity and NaN fixes have focused coverage, including shadowing guards. Its negative-infinity property branch is diagnostic-only; recorded sign differences mean accepting that diagnostic remains conditional, not a blanket constant-equivalence clearance.
413
475
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-sfmc",
3
- "version": "5.4.4",
3
+ "version": "5.5.0",
4
4
  "description": "ESLint plugin for Salesforce Marketing Cloud Engagement+Next - AMPscript, Server-Side JavaScript (SSJS) and Handlebars",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -42,13 +42,19 @@
42
42
  "handlebars-data": "^0.8.2",
43
43
  "mso-conditional-parser": "^2.0.1",
44
44
  "sfmc-handlebars-parser": "^0.2.1",
45
- "ssjs-data": "^2.1.3"
45
+ "ssjs-data": "^2.2.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "eslint": ">=10.0.0"
48
+ "eslint": ">=10.0.0",
49
+ "eslint-plugin-unicorn": ">=57.0.0 <=80.0.0"
50
+ },
51
+ "peerDependenciesMeta": {
52
+ "eslint-plugin-unicorn": {
53
+ "optional": true
54
+ }
49
55
  },
50
56
  "scripts": {
51
- "test": "node --test tests/release-safeguards.test.js tests/metadata.test.js && node --test tests/rules.test.js && node --test tests/deprecated-catalog.test.js && node --test tests/fixtures.test.mjs && node --test tests/autofix-manual.test.mjs && node --test tests/unicorn-protection.test.js tests/unicorn-hazards.test.js tests/unicorn-configs.test.js && node --test tests/unicorn-minimum.test.js",
57
+ "test": "node --test tests/release-safeguards.test.js tests/metadata.test.js && node --test tests/rules.test.js && node --test tests/deprecated-catalog.test.js && node --test tests/fixtures.test.mjs && node --test tests/autofix-manual.test.mjs && node --test tests/unicorn-protection.test.js tests/unicorn-hazards.test.js tests/unicorn-configs.test.js tests/unicorn-audit-database.test.js tests/unicorn-function.test.js && node --test tests/unicorn-minimum.test.js",
52
58
  "verify:own-dependencies-latest": "node scripts/verify-own-dependencies-latest.mjs",
53
59
  "preversion": "npm run verify:own-dependencies-latest",
54
60
  "test:release": "node --test tests/release-safeguards.test.js",
@@ -73,7 +79,7 @@
73
79
  "eslint-minimum": "npm:eslint@10.0.0",
74
80
  "eslint-plugin-jsdoc": "^64.5.4",
75
81
  "eslint-plugin-prettier": "^5.5.6",
76
- "eslint-plugin-unicorn": "^76.0.0",
82
+ "eslint-plugin-unicorn": "^80.0.0",
77
83
  "globals": "^17.12.0",
78
84
  "husky": "^9.1.7",
79
85
  "lint-staged": "^17.5.1",
package/src/index.js CHANGED
@@ -394,11 +394,13 @@ function standaloneHandlebarsConfigs(configName) {
394
394
  // ── Optional eslint-plugin-unicorn override for SSJS ──────────────────────────
395
395
 
396
396
  /**
397
- * The 60 `eslint-plugin-unicorn` recommended rules (analysed against
398
- * unicorn v76.0.0) that are incompatible with the SFMC SSJS (JINT / ES3-ES5)
399
- * engine — they either fix/suggest code using a missing built-in or forbid a required
400
- * SFMC workaround, or enforce ES-module / async / ES6-only syntax that the
401
- * engine cannot run. Each is mapped to `'off'`.
397
+ * The 83 `eslint-plugin-unicorn` recommended rules (audited against unicorn
398
+ * v76.0.0 and v80.0.0; the list is the union of both audits) that are
399
+ * incompatible with the SFMC SSJS (JINT / ES3-ES5) engine — they either
400
+ * fix/suggest code using a missing built-in, change recorded runtime semantics,
401
+ * forbid a required SFMC workaround, or emit ES2015+ syntax that the engine
402
+ * cannot run. Each is mapped to `'off'`. Per-rule verdicts: audit/unicorn/ in
403
+ * the repository (not published).
402
404
  *
403
405
  * This is exposed via the optional `unicorn-ssjs` / `unicorn-ssjs-embedded`
404
406
  * configs. eslint-plugin-sfmc does NOT depend on or load unicorn; these configs
@@ -470,6 +472,27 @@ const unicornSsjsOffRules = {
470
472
  'unicorn/prefer-object-define-properties': 'off',
471
473
  'unicorn/no-new-array': 'off',
472
474
  'unicorn/no-unnecessary-array-splice-count': 'off',
475
+ // Unicorn 80 audit — unavailable built-ins or changed SSJS semantics.
476
+ // New in 80: match() → exec() differs in SSJS (no-match [] vs null, broken groups).
477
+ 'unicorn/prefer-regexp-exec': 'off',
478
+ // New in 80: unescapes \x3C/script> and %%= inside server-side script blocks.
479
+ 'unicorn/prefer-literal-ascii': 'off',
480
+ // Everything below in this group already behaved this way in 76 (missed by the
481
+ // 76 audit); prefer-single-replace and prefer-url-search-parameters reach more
482
+ // code in 80. replaceAll, Object.values/entries, URLSearchParams, Object.hasOwn
483
+ // and Function#bind are unavailable in SSJS.
484
+ 'unicorn/prefer-single-replace': 'off',
485
+ 'unicorn/prefer-object-iterable-methods': 'off',
486
+ 'unicorn/prefer-url-search-parameters': 'off',
487
+ 'unicorn/no-computed-property-existence-check': 'off',
488
+ 'unicorn/dom-node-dataset': 'off',
489
+ 'unicorn/no-array-method-this-argument': 'off',
490
+ // Rewrites the SOAP namespace URI (exacttarget.com/wsdl/partnerAPI) to https.
491
+ 'unicorn/prefer-https': 'off',
492
+ // Drops trailing undefined arguments of arity-bound Platform functions.
493
+ 'unicorn/no-useless-undefined': 'off',
494
+ // new Date(d) drops the milliseconds in SSJS (verified live); new Date(d.getTime()) keeps them.
495
+ 'unicorn/consistent-date-clone': 'off',
473
496
  // Group B — forbid ES6+ syntax / ES-module / async constructs
474
497
  // Inert with strict ES5 parsing, but introduces for-of when block scopes are enabled.
475
498
  'unicorn/no-for-loop': 'off',
@@ -481,8 +504,295 @@ const unicornSsjsOffRules = {
481
504
  'unicorn/prefer-node-protocol': 'off',
482
505
  'unicorn/prefer-top-level-await': 'off',
483
506
  'unicorn/prefer-export-from': 'off',
507
+ // Unicorn 80 audit — fixes/suggestions that emit ES2015+ syntax from ES5 input.
508
+ // New in 80: always writes \u{A0}-style code-point escapes.
509
+ 'unicorn/prefer-escaped-irregular-whitespace': 'off',
510
+ // Everything below already behaved this way in 76 (missed by the 76 audit);
511
+ // no-array-sort-for-min-max and no-immediate-mutation reach more code in 80:
512
+ // ||= / &&=, 1_000 separators, \u{…} escapes, **, ??, spread, computed keys
513
+ // and arrow functions.
514
+ 'unicorn/logical-assignment-operators': 'off',
515
+ 'unicorn/numeric-separators-style': 'off',
516
+ 'unicorn/prefer-unicode-code-point-escapes': 'off',
517
+ 'unicorn/no-xor-as-exponentiation': 'off',
518
+ 'unicorn/prefer-logical-operator-over-ternary': 'off',
519
+ 'unicorn/no-accidental-bitwise-operator': 'off',
520
+ 'unicorn/no-array-sort-for-min-max': 'off',
521
+ 'unicorn/no-immediate-mutation': 'off',
522
+ 'unicorn/no-array-callback-reference': 'off',
523
+ 'unicorn/no-boolean-sort-comparator': 'off',
524
+ 'unicorn/prefer-simple-sort-comparator': 'off',
484
525
  };
485
526
 
527
+ /**
528
+ * Every `eslint-plugin-unicorn` rule the newest audit marked safe for SSJS
529
+ * (verdict `active` there and not in `unicornSsjsOffRules`). A rule only an
530
+ * older audit covered stays off: the newest version was not checked for it.
531
+ * `unicornSsjs()` leaves these to the user's own
532
+ * unicorn config and turns every other unicorn rule off for SSJS, so renamed,
533
+ * new or unaudited rules stay off until an audit adds them here.
534
+ * tests/unicorn-function.test.js keeps this list equal to audit/unicorn/.
535
+ */
536
+ const unicornSsjsActiveRules = new Set([
537
+ 'better-dom-traversing',
538
+ 'catch-error-name',
539
+ 'class-reference-in-static-methods',
540
+ 'consistent-assert',
541
+ 'consistent-boolean-name',
542
+ 'consistent-class-member-order',
543
+ 'consistent-compound-words',
544
+ 'consistent-conditional-object-spread',
545
+ 'consistent-empty-array-spread',
546
+ 'consistent-existence-index-check',
547
+ 'consistent-export-decorator-position',
548
+ 'consistent-function-scoping',
549
+ 'consistent-json-file-read',
550
+ 'consistent-optional-chaining',
551
+ 'consistent-template-literal-escape',
552
+ 'consistent-tuple-labels',
553
+ 'default-export-style',
554
+ 'empty-brace-spaces',
555
+ 'error-message',
556
+ 'escape-case',
557
+ 'expiring-todo-comments',
558
+ 'explicit-length-check',
559
+ 'explicit-timer-delay',
560
+ 'filename-case',
561
+ 'import-style',
562
+ 'isolated-functions',
563
+ 'max-nested-calls',
564
+ 'name-replacements',
565
+ 'new-for-builtins',
566
+ 'no-abusive-eslint-disable',
567
+ 'no-accessor-recursion',
568
+ 'no-anonymous-default-export',
569
+ 'no-array-concat-in-loop',
570
+ 'no-array-fill-with-reference-type',
571
+ 'no-array-from-fill',
572
+ 'no-array-reduce',
573
+ 'no-asterisk-prefix-in-documentation-comments',
574
+ 'no-async-iterator-callback',
575
+ 'no-await-expression-member',
576
+ 'no-await-in-promise-methods',
577
+ 'no-blob-to-file',
578
+ 'no-break-in-nested-loop',
579
+ 'no-canvas-to-image',
580
+ 'no-chained-comparison',
581
+ 'no-collection-bracket-access',
582
+ 'no-conflicting-constraints',
583
+ 'no-confusing-array-splice',
584
+ 'no-confusing-array-with',
585
+ 'no-console-spaces',
586
+ 'no-constant-zero-expression',
587
+ 'no-declarations-before-early-exit',
588
+ 'no-document-cookie',
589
+ 'no-double-comparison',
590
+ 'no-duplicate-if-branches',
591
+ 'no-duplicate-logical-operands',
592
+ 'no-duplicate-loops',
593
+ 'no-duplicate-set-values',
594
+ 'no-empty-file',
595
+ 'no-error-property-assignment',
596
+ 'no-exports-in-scripts',
597
+ 'no-global-object-property-assignment',
598
+ 'no-incomplete-accessor-override',
599
+ 'no-incorrect-query-selector',
600
+ 'no-incorrect-template-string-interpolation',
601
+ 'no-ineffective-csp-directives',
602
+ 'no-invalid-argument-count',
603
+ 'no-invalid-boolean-attribute-value',
604
+ 'no-invalid-character-comparison',
605
+ 'no-invalid-dom-token',
606
+ 'no-invalid-fetch-options',
607
+ 'no-invalid-integrity',
608
+ 'no-invalid-intl-options',
609
+ 'no-invalid-property-descriptor',
610
+ 'no-invalid-remove-event-listener',
611
+ 'no-invalid-response-options',
612
+ 'no-invalid-style-set-property',
613
+ 'no-invalid-temporal-arithmetic',
614
+ 'no-invalid-url-protocol-comparison',
615
+ 'no-invalid-well-known-symbol-methods',
616
+ 'no-late-current-target-access',
617
+ 'no-late-event-control',
618
+ 'no-leading-empty-lines',
619
+ 'no-lonely-if',
620
+ 'no-loop-iterable-mutation',
621
+ 'no-magic-array-flat-depth',
622
+ 'no-mismatched-map-key',
623
+ 'no-misrefactored-assignment',
624
+ 'no-multiple-promise-resolver-calls',
625
+ 'no-named-default',
626
+ 'no-negated-array-predicate',
627
+ 'no-negated-comparison',
628
+ 'no-negated-condition',
629
+ 'no-negation-in-equality-check',
630
+ 'no-nested-ternary',
631
+ 'no-new-buffer',
632
+ 'no-non-function-verb-prefix',
633
+ 'no-nonstandard-builtin-properties',
634
+ 'no-null',
635
+ 'no-object-as-default-parameter',
636
+ 'no-object-methods-with-collections',
637
+ 'no-optional-chaining-on-undeclared-variable',
638
+ 'no-prevent-default-in-passive-listener',
639
+ 'no-process-exit',
640
+ 'no-return-array-push',
641
+ 'no-selector-as-dom-name',
642
+ 'no-shorthand-property-overrides',
643
+ 'no-single-promise-in-promise-methods',
644
+ 'no-static-only-class',
645
+ 'no-subtraction-comparison',
646
+ 'no-thenable',
647
+ 'no-this-assignment',
648
+ 'no-this-outside-of-class',
649
+ 'no-top-level-assignment-in-function',
650
+ 'no-top-level-side-effects',
651
+ 'no-transition-all',
652
+ 'no-typeof-undefined',
653
+ 'no-uncalled-method',
654
+ 'no-undeclared-class-members',
655
+ 'no-unnecessary-array-flat-depth',
656
+ 'no-unnecessary-array-flat-map',
657
+ 'no-unnecessary-await',
658
+ 'no-unnecessary-boolean-comparison',
659
+ 'no-unnecessary-fetch-options',
660
+ 'no-unnecessary-global-this',
661
+ 'no-unnecessary-nested-ternary',
662
+ 'no-unnecessary-parameters',
663
+ 'no-unnecessary-polyfills',
664
+ 'no-unnecessary-slice-end',
665
+ 'no-unnecessary-string-trim',
666
+ 'no-unreadable-array-destructuring',
667
+ 'no-unreadable-for-of-expression',
668
+ 'no-unreadable-iife',
669
+ 'no-unreadable-object-destructuring',
670
+ 'no-unsafe-buffer-conversion',
671
+ 'no-unsafe-json-serialization',
672
+ 'no-unsafe-promise-all-settled-values',
673
+ 'no-unsafe-property-key',
674
+ 'no-unsafe-sqlite-interpolation',
675
+ 'no-unsafe-string-replacement',
676
+ 'no-unused-builtin-method-return',
677
+ 'no-unused-iterator-helper',
678
+ 'no-url-in-search-params',
679
+ 'no-useless-boolean-cast',
680
+ 'no-useless-collection-argument',
681
+ 'no-useless-compound-assignment',
682
+ 'no-useless-concat',
683
+ 'no-useless-continue',
684
+ 'no-useless-delete-check',
685
+ 'no-useless-else',
686
+ 'no-useless-error-capture-stack-trace',
687
+ 'no-useless-fallback-in-spread',
688
+ 'no-useless-iterator-to-array',
689
+ 'no-useless-length-check',
690
+ 'no-useless-logical-operand',
691
+ 'no-useless-override',
692
+ 'no-useless-promise-resolve-reject',
693
+ 'no-useless-re-export',
694
+ 'no-useless-recursion',
695
+ 'no-useless-set-construction',
696
+ 'no-useless-spread',
697
+ 'no-useless-switch-case',
698
+ 'no-useless-template-literals',
699
+ 'no-using-resource-escape',
700
+ 'no-zero-fractions',
701
+ 'number-literal-case',
702
+ 'operator-assignment',
703
+ 'prefer-abort-signal-any',
704
+ 'prefer-abort-signal-timeout',
705
+ 'prefer-add-event-listener',
706
+ 'prefer-add-event-listener-options',
707
+ 'prefer-aggregate-error',
708
+ 'prefer-array-from-map',
709
+ 'prefer-array-from-range',
710
+ 'prefer-array-iterable-methods',
711
+ 'prefer-array-slice',
712
+ 'prefer-await',
713
+ 'prefer-bigint-literals',
714
+ 'prefer-blob-reading-methods',
715
+ 'prefer-block-statement-over-iife',
716
+ 'prefer-boolean-return',
717
+ 'prefer-class-fields',
718
+ 'prefer-classlist-toggle',
719
+ 'prefer-combined-guards',
720
+ 'prefer-continue',
721
+ 'prefer-direct-iteration',
722
+ 'prefer-dom-node-append',
723
+ 'prefer-dom-node-html-methods',
724
+ 'prefer-dom-node-remove',
725
+ 'prefer-dom-node-replace-children',
726
+ 'prefer-dom-node-text-content',
727
+ 'prefer-early-return',
728
+ 'prefer-else-if',
729
+ 'prefer-event-target',
730
+ 'prefer-flat-math-min-max',
731
+ 'prefer-get-or-insert-computed',
732
+ 'prefer-global-number-constants',
733
+ 'prefer-global-this',
734
+ 'prefer-has-check',
735
+ 'prefer-hoisting-branch-code',
736
+ 'prefer-identifier-import-export-specifiers',
737
+ 'prefer-iterable-in-constructor',
738
+ 'prefer-iterator-to-array',
739
+ 'prefer-iterator-to-array-at-end',
740
+ 'prefer-keyboard-event-key',
741
+ 'prefer-location-assign',
742
+ 'prefer-math-abs',
743
+ 'prefer-math-constants',
744
+ 'prefer-math-min-max',
745
+ 'prefer-minimal-ternary',
746
+ 'prefer-modern-dom-apis',
747
+ 'prefer-object-destructuring-defaults',
748
+ 'prefer-observer-apis',
749
+ 'prefer-options-parameter',
750
+ 'prefer-path2d',
751
+ 'prefer-private-class-fields',
752
+ 'prefer-promise-static-methods',
753
+ 'prefer-promise-try',
754
+ 'prefer-promise-with-resolvers',
755
+ 'prefer-prototype-methods',
756
+ 'prefer-query-selector',
757
+ 'prefer-queue-microtask',
758
+ 'prefer-response-static-json',
759
+ 'prefer-scoped-selector',
760
+ 'prefer-short-escape-sequences',
761
+ 'prefer-simple-condition-first',
762
+ 'prefer-simplified-conditions',
763
+ 'prefer-single-array-predicate',
764
+ 'prefer-single-call',
765
+ 'prefer-single-object-destructuring',
766
+ 'prefer-smaller-scope',
767
+ 'prefer-split-limit',
768
+ 'prefer-switch',
769
+ 'prefer-ternary',
770
+ 'prefer-then-catch',
771
+ 'prefer-toggle-attribute',
772
+ 'prefer-type-error',
773
+ 'prefer-type-literal-last',
774
+ 'prefer-unary-minus',
775
+ 'prefer-url-can-parse',
776
+ 'prefer-url-href',
777
+ 'prefer-while-loop-condition',
778
+ 'relative-url-style',
779
+ 'require-array-join-separator',
780
+ 'require-css-escape',
781
+ 'require-module-attributes',
782
+ 'require-module-specifiers',
783
+ 'require-number-to-fixed-digits-argument',
784
+ 'require-passive-events',
785
+ 'require-proxy-trap-boolean-return',
786
+ 'require-spread-parentheses',
787
+ 'require-text-decoder-streaming',
788
+ 'single-line-block-comment-style',
789
+ 'switch-case-braces',
790
+ 'switch-case-break-position',
791
+ 'template-indent',
792
+ 'text-encoding-identifier-case',
793
+ 'throw-new-error',
794
+ ]);
795
+
486
796
  // ── MSO / Outlook email rule configs (auto-included, no separate plugin load) ──
487
797
 
488
798
  /**
@@ -877,7 +1187,7 @@ plugin.configs = {
877
1187
  // ── Required overrides when eslint-plugin-unicorn covers SSJS ────────────
878
1188
 
879
1189
  /**
880
- * REQUIRED when unicorn covers standalone `.ssjs` files: turns off the 60
1190
+ * REQUIRED when unicorn covers standalone `.ssjs` files: turns off the 83
881
1191
  * unicorn recommended rules incompatible with SFMC SSJS. Plain rules object with NO
882
1192
  * `plugins` key — eslint-plugin-sfmc does not load unicorn. Insert this object
883
1193
  * AFTER your own unicorn config (which registers the `unicorn` plugin);
@@ -891,7 +1201,7 @@ plugin.configs = {
891
1201
  },
892
1202
 
893
1203
  /**
894
- * REQUIRED when unicorn covers SSJS embedded in HTML: same 60-rule override
1204
+ * REQUIRED when unicorn covers SSJS embedded in HTML: same 83-rule override
895
1205
  * for virtual `**\/*.html/*.js` files. Insert AFTER your unicorn config.
896
1206
  * Omit this config if unicorn is not enabled for embedded SSJS.
897
1207
  */
@@ -902,4 +1212,41 @@ plugin.configs = {
902
1212
  },
903
1213
  };
904
1214
 
1215
+ /**
1216
+ * One-line unicorn setup for SSJS (standalone `.ssjs` and SSJS embedded in
1217
+ * HTML). Pass the `eslint-plugin-unicorn` object you import and spread the
1218
+ * result after your own unicorn config:
1219
+ *
1220
+ * ...sfmc.unicornSsjs(eslintPluginUnicorn)
1221
+ *
1222
+ * Every rule of the given unicorn version that no audit marked safe for SSJS
1223
+ * is turned off; the audited rules keep whatever your unicorn config sets.
1224
+ * Only `'off'` is written, so a rule missing from an older or newer unicorn
1225
+ * never causes a "Could not find rule" error.
1226
+ *
1227
+ * @param {{ rules: object }} unicorn - The imported eslint-plugin-unicorn plugin.
1228
+ * @returns {object[]} Flat config objects to spread into the config array.
1229
+ */
1230
+ plugin.unicornSsjs = function unicornSsjs(unicorn) {
1231
+ if (!unicorn || typeof unicorn.rules !== 'object' || unicorn.rules === null) {
1232
+ throw new TypeError(
1233
+ 'sfmc.unicornSsjs(unicorn) expects the imported eslint-plugin-unicorn plugin',
1234
+ );
1235
+ }
1236
+ const rules = {};
1237
+ for (const name of Object.keys(unicorn.rules)) {
1238
+ if (!unicornSsjsActiveRules.has(name)) {
1239
+ rules[`unicorn/${name}`] = 'off';
1240
+ }
1241
+ }
1242
+ return [
1243
+ {
1244
+ name: 'sfmc/unicorn-ssjs-allowlist',
1245
+ files: ['**/*.ssjs', '**/*.html/*.js'],
1246
+ plugins: { unicorn },
1247
+ rules,
1248
+ },
1249
+ ];
1250
+ };
1251
+
905
1252
  export default plugin;
@@ -49,7 +49,7 @@ function staticLiteralValue(argument) {
49
49
  * @param {string | number | boolean} actual - Static AMPscript literal value.
50
50
  * @returns {boolean} Whether the values match with type-sensitive semantics.
51
51
  */
52
- function enumValueMatches(allowed, actual) {
52
+ function isEnumValueMatch(allowed, actual) {
53
53
  if (typeof allowed !== typeof actual) {
54
54
  return false;
55
55
  }
@@ -108,7 +108,7 @@ export default {
108
108
  continue;
109
109
  }
110
110
  const isAllowed = parameter.enum.some((value) =>
111
- enumValueMatches(value, actual),
111
+ isEnumValueMatch(value, actual),
112
112
  );
113
113
  if (!isAllowed) {
114
114
  context.report({
@@ -58,11 +58,12 @@ export default {
58
58
  };
59
59
 
60
60
  function hasMemberLength(node) {
61
- return node
62
- ? node.type === 'MemberExpression' &&
63
- node.property.type === 'Identifier' &&
64
- node.property.name === 'length'
65
- : false;
61
+ return (
62
+ Boolean(node) &&
63
+ node.type === 'MemberExpression' &&
64
+ node.property.type === 'Identifier' &&
65
+ node.property.name === 'length'
66
+ );
66
67
  }
67
68
 
68
69
  function buildCacheFix(forNode, lengthExpression, context) {
@@ -65,10 +65,11 @@ function isHttpConstructorMember(node) {
65
65
  * @returns {boolean} Whether the expression yields an HTTP request instance
66
66
  */
67
67
  function isHttpRequestInit(node) {
68
- return node
69
- ? (node.type === 'NewExpression' || node.type === 'CallExpression') &&
70
- isHttpConstructorMember(node.callee)
71
- : false;
68
+ return (
69
+ Boolean(node) &&
70
+ (node.type === 'NewExpression' || node.type === 'CallExpression') &&
71
+ isHttpConstructorMember(node.callee)
72
+ );
72
73
  }
73
74
 
74
75
  /**
@@ -73,10 +73,11 @@ function isHttpConstructorMember(node) {
73
73
  * @returns {boolean} Whether the expression yields an HTTP request instance
74
74
  */
75
75
  function isHttpRequestInit(node) {
76
- return node
77
- ? (node.type === 'NewExpression' || node.type === 'CallExpression') &&
78
- isHttpConstructorMember(node.callee)
79
- : false;
76
+ return (
77
+ Boolean(node) &&
78
+ (node.type === 'NewExpression' || node.type === 'CallExpression') &&
79
+ isHttpConstructorMember(node.callee)
80
+ );
80
81
  }
81
82
 
82
83
  export default {
@@ -58,10 +58,11 @@ function isHttpConstructorMember(node) {
58
58
  * @returns {boolean} Whether the expression yields an HTTP request instance
59
59
  */
60
60
  function isHttpRequestInit(node) {
61
- return node
62
- ? (node.type === 'NewExpression' || node.type === 'CallExpression') &&
63
- isHttpConstructorMember(node.callee)
64
- : false;
61
+ return (
62
+ Boolean(node) &&
63
+ (node.type === 'NewExpression' || node.type === 'CallExpression') &&
64
+ isHttpConstructorMember(node.callee)
65
+ );
65
66
  }
66
67
 
67
68
  /**
@@ -27,7 +27,7 @@ import { notDefinedAtRuntimeGlobalLookup } from 'ssjs-data';
27
27
  */
28
28
  function replacementFor(entry) {
29
29
  const source = `${entry.officialDocsNote ?? ''} ${entry.description ?? ''}`;
30
- const match = source.match(/Platform\.[A-Za-z.]+\([^)]*\)/);
30
+ const match = /Platform\.[A-Za-z.]+\([^)]*\)/.exec(source);
31
31
  return match ? match[0] : 'a supported alternative';
32
32
  }
33
33
 
@@ -44,21 +44,18 @@ export default {
44
44
  function isTreatAsContentCall(node) {
45
45
  const callee = node.callee;
46
46
 
47
- // TreatAsContent(...)
48
- if (callee.type === 'Identifier' && callee.name === 'TreatAsContent') {
49
- return true;
50
- }
51
-
52
- // Platform.Function.TreatAsContent(...)
53
47
  return (
54
- callee.type === 'MemberExpression' &&
55
- callee.property.type === 'Identifier' &&
56
- callee.property.name === 'TreatAsContent' &&
57
- callee.object.type === 'MemberExpression' &&
58
- callee.object.property.type === 'Identifier' &&
59
- callee.object.property.name === 'Function' &&
60
- callee.object.object.type === 'Identifier' &&
61
- callee.object.object.name === 'Platform'
48
+ // TreatAsContent(...)
49
+ (callee.type === 'Identifier' && callee.name === 'TreatAsContent') ||
50
+ // Platform.Function.TreatAsContent(...)
51
+ (callee.type === 'MemberExpression' &&
52
+ callee.property.type === 'Identifier' &&
53
+ callee.property.name === 'TreatAsContent' &&
54
+ callee.object.type === 'MemberExpression' &&
55
+ callee.object.property.type === 'Identifier' &&
56
+ callee.object.property.name === 'Function' &&
57
+ callee.object.object.type === 'Identifier' &&
58
+ callee.object.object.name === 'Platform')
62
59
  );
63
60
  }
64
61
 
@@ -229,10 +229,7 @@ export default {
229
229
  }
230
230
 
231
231
  // ── Prototype methods with NO polyfill: .trimStart(), .flat(), … ─
232
- if (!knownUnsupportedByPrototypeName.has(lowerMethod)) {
233
- return;
234
- }
235
- if (ignored.has(methodName)) {
232
+ if (!knownUnsupportedByPrototypeName.has(lowerMethod) || ignored.has(methodName)) {
236
233
  return;
237
234
  }
238
235
  // Skip known SFMC top-level objects to avoid false positives.
@@ -240,6 +237,11 @@ export default {
240
237
  return;
241
238
  }
242
239
  const entry = knownUnsupportedByPrototypeName.get(lowerMethod);
240
+ // Missing globals (Set, URL, Promise, …) are not methods: obj.set() or
241
+ // obj.url() is a call on the user's own object, not on the global.
242
+ if (entry.owner === 'Global' || entry.owner === 'GlobalValues') {
243
+ return;
244
+ }
243
245
  pendingReports.push({ node: property, entry, noPolyfill: true });
244
246
  },
245
247
 
@@ -54,36 +54,30 @@ export default {
54
54
  function isParseJSONCall(node) {
55
55
  const callee = node.callee;
56
56
 
57
- // ParseJSON(...)
58
- if (callee.type === 'Identifier' && callee.name === 'ParseJSON') {
59
- return true;
60
- }
61
-
62
- // Platform.Function.ParseJSON(...)
63
57
  return (
64
- callee.type === 'MemberExpression' &&
65
- callee.property.type === 'Identifier' &&
66
- callee.property.name === 'ParseJSON' &&
67
- callee.object.type === 'MemberExpression' &&
68
- callee.object.property.type === 'Identifier' &&
69
- callee.object.property.name === 'Function' &&
70
- callee.object.object.type === 'Identifier' &&
71
- callee.object.object.name === 'Platform'
58
+ // ParseJSON(...)
59
+ (callee.type === 'Identifier' && callee.name === 'ParseJSON') ||
60
+ // Platform.Function.ParseJSON(...)
61
+ (callee.type === 'MemberExpression' &&
62
+ callee.property.type === 'Identifier' &&
63
+ callee.property.name === 'ParseJSON' &&
64
+ callee.object.type === 'MemberExpression' &&
65
+ callee.object.property.type === 'Identifier' &&
66
+ callee.object.property.name === 'Function' &&
67
+ callee.object.object.type === 'Identifier' &&
68
+ callee.object.object.name === 'Platform')
72
69
  );
73
70
  }
74
71
 
75
72
  function isAlreadySafe(argument) {
76
- // arg + '' or '' + arg
77
- if (
78
- argument.type === 'BinaryExpression' &&
79
- argument.operator === '+' &&
80
- (isEmptyString(argument.left) || isEmptyString(argument.right))
81
- ) {
82
- return true;
83
- }
84
-
85
- // String literal passed directly — already a string
86
- return argument.type === 'Literal' && typeof argument.value === 'string';
73
+ return (
74
+ // arg + '' or '' + arg
75
+ (argument.type === 'BinaryExpression' &&
76
+ argument.operator === '+' &&
77
+ (isEmptyString(argument.left) || isEmptyString(argument.right))) ||
78
+ // String literal passed directly — already a string
79
+ (argument.type === 'Literal' && typeof argument.value === 'string')
80
+ );
87
81
  }
88
82
 
89
83
  function isEmptyString(node) {
@@ -46,10 +46,11 @@ function isHttpConstructorMember(node) {
46
46
  * @returns {boolean} Whether the expression yields an HTTP request instance
47
47
  */
48
48
  function isHttpRequestInit(node) {
49
- return node
50
- ? (node.type === 'NewExpression' || node.type === 'CallExpression') &&
51
- isHttpConstructorMember(node.callee)
52
- : false;
49
+ return (
50
+ Boolean(node) &&
51
+ (node.type === 'NewExpression' || node.type === 'CallExpression') &&
52
+ isHttpConstructorMember(node.callee)
53
+ );
53
54
  }
54
55
 
55
56
  /**
@@ -327,11 +327,11 @@ function isTypeCompatible(actual, expected) {
327
327
  return true;
328
328
  }
329
329
  const allowed = expected.split('|').map((t) => t.trim());
330
- if (allowed.includes(actual)) {
331
- return true;
332
- }
333
- // 'array' is compatible with typed array variants
334
- return Boolean(allowed.includes('array') && (actual === 'string[]' || actual === 'number[]'));
330
+ return (
331
+ allowed.includes(actual) ||
332
+ // 'array' is compatible with typed array variants
333
+ (allowed.includes('array') && (actual === 'string[]' || actual === 'number[]'))
334
+ );
335
335
  }
336
336
 
337
337
  function isWSProxyConstructor(node) {