@interlace/eslint-devkit 1.19.3 → 1.19.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interlace/eslint-devkit",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "description": "Toolkit for building ESLint plugins in TypeScript — AST helpers, type utilities, rule-creation scaffolding, security benchmarks, and SARIF output.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -3,47 +3,20 @@
3
3
  * Licensed under the MIT License. Use of this source code is governed by the
4
4
  * MIT license that can be found in the LICENSE file.
5
5
  */
6
- /**
7
- * Whole-word membership tests over an identifier's segments.
8
- *
9
- * WHY THIS EXISTS
10
- *
11
- * Seven rules independently wrote `haystack.includes(word)` against a
12
- * vocabulary, and every one of them shipped the same false positives, because
13
- * English words contain other English words:
14
- *
15
- * passengers contains pass → "Password length requirement is too weak"
16
- * microphoneEnabled contains phone → "PII in console logs"
17
- * casserole contains role → "Authentication logic in client code"
18
- * contractAddress contains address → "Sensitive field sent to analytics"
19
- * promoteOffer contains promote → "Privilege escalation"
20
- * midnight contains dn → "LDAP injection"
21
- * sessionStorageKey contains session → "Hardcoded session token"
22
- *
23
- * Those are not hypotheticals. Each was produced by running the shipped rule
24
- * against the snippet above, and `no-client-side-auth-logic` — the `casserole`
25
- * one — is in `browser-security/recommended` at `error`, so it reached every
26
- * consumer of the preset.
27
- *
28
- * WHAT THIS DOES AND DOES NOT LICENSE
29
- *
30
- * Matching a name by whole word is still matching a NAME. CLAUDE.md permits it
31
- * only where the name NARROWS evidence the rule has already proven — a resolved
32
- * sink, a resolved taint root, a specific call shape — and never as the whole
33
- * verdict. Swapping `includes()` for this helper fixes the false-positive half
34
- * of that defect; it does nothing for the false-negative half, where renaming a
35
- * genuinely tainted variable silences a real finding. That half needs binding
36
- * resolution, not better string matching.
37
- *
38
- * In other words: this makes a permitted pattern correct. It does not make a
39
- * forbidden pattern permitted.
40
- */
41
6
  /**
42
7
  * Split an identifier into lower-cased words.
43
8
  *
44
9
  * Handles camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE, and
45
10
  * the acronym boundary (`parseXMLDocument` → `parse`, `xml`, `document`), which
46
11
  * a naive `/(?=[A-Z])/` split gets wrong by producing `x`, `m`, `l`.
12
+ *
13
+ * A single left-to-right scan, not a `.replace()` chain: `/([A-Z]+)([A-Z][a-z])/g`
14
+ * against an all-caps string with no trailing lowercase (nothing for the second
15
+ * group to ever match) backtracked the first group one character at a time from
16
+ * every start position — quadratic in the identifier length, and CodeQL flagged
17
+ * it (js/polynomial-redos, alert #1331). `identifierWords` runs on identifiers
18
+ * pulled from whatever source a rule lints, so that length is not this
19
+ * function's to bound. Each character here is inspected exactly once.
47
20
  */
48
21
  export declare function identifierWords(name: string): string[];
49
22
  /**
Binary file