eslint-plugin-node-security 4.6.0 → 4.7.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.
Files changed (120) hide show
  1. package/README.md +1 -0
  2. package/package.json +5 -8
  3. package/src/index.d.ts +17 -10
  4. package/src/index.js +5 -36
  5. package/src/oxlint.d.ts +17 -20
  6. package/src/oxlint.js +0 -19
  7. package/src/rules/detect-child-process/index.js +0 -107
  8. package/src/rules/detect-eval-with-expression/index.js +2 -48
  9. package/src/rules/detect-non-literal-fs-filename/index.js +0 -82
  10. package/src/rules/detect-suspicious-dependencies/index.js +0 -12
  11. package/src/rules/lock-file/index.js +0 -18
  12. package/src/rules/no-arbitrary-file-access/index.js +0 -52
  13. package/src/rules/no-buffer-overread/index.js +3 -96
  14. package/src/rules/no-cryptojs/index.js +2 -10
  15. package/src/rules/no-cryptojs-weak-random/index.js +1 -13
  16. package/src/rules/no-data-in-temp-storage/index.js +0 -12
  17. package/src/rules/no-deprecated-buffer/index.js +0 -15
  18. package/src/rules/no-deprecated-cipher-method/index.js +0 -9
  19. package/src/rules/no-dynamic-algorithm-selection/index.js +0 -13
  20. package/src/rules/no-dynamic-command-string/index.js +201 -0
  21. package/src/rules/no-dynamic-dependency-loading/index.js +0 -13
  22. package/src/rules/no-dynamic-require/index.js +0 -10
  23. package/src/rules/no-ecb-mode/index.js +0 -7
  24. package/src/rules/no-insecure-key-derivation/index.js +0 -10
  25. package/src/rules/no-insecure-rsa-padding/index.js +0 -9
  26. package/src/rules/no-math-random-crypto/index.js +1 -17
  27. package/src/rules/no-self-signed-certs/index.js +1 -9
  28. package/src/rules/no-sha1-hash/index.js +0 -9
  29. package/src/rules/no-shell-injection/index.js +0 -20
  30. package/src/rules/no-ssrf/index.js +4 -80
  31. package/src/rules/no-static-iv/index.js +2 -21
  32. package/src/rules/no-timing-unsafe-compare/index.js +1 -11
  33. package/src/rules/no-toctou-vulnerability/index.js +0 -22
  34. package/src/rules/no-unsafe-buffer-alloc/index.js +0 -13
  35. package/src/rules/no-unsafe-dynamic-require/index.js +0 -22
  36. package/src/rules/no-weak-cipher-algorithm/index.js +0 -19
  37. package/src/rules/no-weak-hash-algorithm/index.js +0 -22
  38. package/src/rules/no-zip-slip/index.js +3 -81
  39. package/src/rules/prefer-native-crypto/index.js +4 -11
  40. package/src/rules/require-dependency-integrity/index.js +0 -11
  41. package/src/rules/require-secure-credential-storage/index.js +0 -12
  42. package/src/rules/require-secure-deletion/index.js +0 -29
  43. package/src/rules/require-storage-encryption/index.js +0 -12
  44. package/src/types/index.js +0 -6
  45. package/CHANGELOG.md +0 -413
  46. package/src/index.js.map +0 -1
  47. package/src/oxlint.js.map +0 -1
  48. package/src/rules/detect-child-process/index.d.ts +0 -52
  49. package/src/rules/detect-child-process/index.js.map +0 -1
  50. package/src/rules/detect-eval-with-expression/index.d.ts +0 -46
  51. package/src/rules/detect-eval-with-expression/index.js.map +0 -1
  52. package/src/rules/detect-non-literal-fs-filename/index.d.ts +0 -52
  53. package/src/rules/detect-non-literal-fs-filename/index.js.map +0 -1
  54. package/src/rules/detect-suspicious-dependencies/index.d.ts +0 -12
  55. package/src/rules/detect-suspicious-dependencies/index.js.map +0 -1
  56. package/src/rules/lock-file/index.d.ts +0 -13
  57. package/src/rules/lock-file/index.js.map +0 -1
  58. package/src/rules/no-arbitrary-file-access/index.d.ts +0 -12
  59. package/src/rules/no-arbitrary-file-access/index.js.map +0 -1
  60. package/src/rules/no-buffer-overread/index.d.ts +0 -39
  61. package/src/rules/no-buffer-overread/index.js.map +0 -1
  62. package/src/rules/no-cryptojs/index.d.ts +0 -24
  63. package/src/rules/no-cryptojs/index.js.map +0 -1
  64. package/src/rules/no-cryptojs-weak-random/index.d.ts +0 -24
  65. package/src/rules/no-cryptojs-weak-random/index.js.map +0 -1
  66. package/src/rules/no-data-in-temp-storage/index.d.ts +0 -14
  67. package/src/rules/no-data-in-temp-storage/index.js.map +0 -1
  68. package/src/rules/no-deprecated-buffer/index.d.ts +0 -23
  69. package/src/rules/no-deprecated-buffer/index.js.map +0 -1
  70. package/src/rules/no-deprecated-cipher-method/index.d.ts +0 -23
  71. package/src/rules/no-deprecated-cipher-method/index.js.map +0 -1
  72. package/src/rules/no-dynamic-algorithm-selection/index.d.ts +0 -26
  73. package/src/rules/no-dynamic-algorithm-selection/index.js.map +0 -1
  74. package/src/rules/no-dynamic-dependency-loading/index.d.ts +0 -12
  75. package/src/rules/no-dynamic-dependency-loading/index.js.map +0 -1
  76. package/src/rules/no-dynamic-require/index.d.ts +0 -21
  77. package/src/rules/no-dynamic-require/index.js.map +0 -1
  78. package/src/rules/no-ecb-mode/index.d.ts +0 -23
  79. package/src/rules/no-ecb-mode/index.js.map +0 -1
  80. package/src/rules/no-insecure-key-derivation/index.d.ts +0 -24
  81. package/src/rules/no-insecure-key-derivation/index.js.map +0 -1
  82. package/src/rules/no-insecure-rsa-padding/index.d.ts +0 -24
  83. package/src/rules/no-insecure-rsa-padding/index.js.map +0 -1
  84. package/src/rules/no-math-random-crypto/index.d.ts +0 -26
  85. package/src/rules/no-math-random-crypto/index.js.map +0 -1
  86. package/src/rules/no-self-signed-certs/index.d.ts +0 -23
  87. package/src/rules/no-self-signed-certs/index.js.map +0 -1
  88. package/src/rules/no-sha1-hash/index.d.ts +0 -24
  89. package/src/rules/no-sha1-hash/index.js.map +0 -1
  90. package/src/rules/no-shell-injection/index.d.ts +0 -20
  91. package/src/rules/no-shell-injection/index.js.map +0 -1
  92. package/src/rules/no-ssrf/index.d.ts +0 -25
  93. package/src/rules/no-ssrf/index.js.map +0 -1
  94. package/src/rules/no-static-iv/index.d.ts +0 -23
  95. package/src/rules/no-static-iv/index.js.map +0 -1
  96. package/src/rules/no-timing-unsafe-compare/index.d.ts +0 -23
  97. package/src/rules/no-timing-unsafe-compare/index.js.map +0 -1
  98. package/src/rules/no-toctou-vulnerability/index.d.ts +0 -26
  99. package/src/rules/no-toctou-vulnerability/index.js.map +0 -1
  100. package/src/rules/no-unsafe-buffer-alloc/index.d.ts +0 -47
  101. package/src/rules/no-unsafe-buffer-alloc/index.js.map +0 -1
  102. package/src/rules/no-unsafe-dynamic-require/index.d.ts +0 -19
  103. package/src/rules/no-unsafe-dynamic-require/index.js.map +0 -1
  104. package/src/rules/no-weak-cipher-algorithm/index.d.ts +0 -25
  105. package/src/rules/no-weak-cipher-algorithm/index.js.map +0 -1
  106. package/src/rules/no-weak-hash-algorithm/index.d.ts +0 -25
  107. package/src/rules/no-weak-hash-algorithm/index.js.map +0 -1
  108. package/src/rules/no-zip-slip/index.d.ts +0 -35
  109. package/src/rules/no-zip-slip/index.js.map +0 -1
  110. package/src/rules/prefer-native-crypto/index.d.ts +0 -23
  111. package/src/rules/prefer-native-crypto/index.js.map +0 -1
  112. package/src/rules/require-dependency-integrity/index.d.ts +0 -12
  113. package/src/rules/require-dependency-integrity/index.js.map +0 -1
  114. package/src/rules/require-secure-credential-storage/index.d.ts +0 -12
  115. package/src/rules/require-secure-credential-storage/index.js.map +0 -1
  116. package/src/rules/require-secure-deletion/index.d.ts +0 -17
  117. package/src/rules/require-secure-deletion/index.js.map +0 -1
  118. package/src/rules/require-storage-encryption/index.d.ts +0 -12
  119. package/src/rules/require-storage-encryption/index.js.map +0 -1
  120. package/src/types/index.js.map +0 -1
package/CHANGELOG.md DELETED
@@ -1,413 +0,0 @@
1
- ## 4.6.0
2
-
3
- ### Minor Changes
4
-
5
- - [#305](https://github.com/ofri-peretz/eslint/pull/305) [`8f1c9ef`](https://github.com/ofri-peretz/eslint/commit/8f1c9efbe99c592f8ed5ffca2d1ed8f53408af19) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - New rule `no-unsafe-buffer-alloc` (CWE-908, Use of Uninitialized Resource) —
6
- closes a measured coverage gap against `security-node/detect-buffer-unsafe-allocation`
7
- and `@microsoft/eslint-plugin-sdl/no-unsafe-alloc`.
8
-
9
- It reports `Buffer.allocUnsafe()` and `Buffer.allocUnsafeSlow()`, both of which
10
- return memory that was never zeroed, with a suggestion to swap in
11
- `Buffer.alloc()`. Neither the existing `no-deprecated-buffer` (deprecated
12
- `Buffer()` constructor, CWE-676) nor `no-buffer-overread` (read-side CWE-126)
13
- flagged the allocation itself.
14
-
15
- **The rule is unconditional and does no dataflow** — it does not try to prove
16
- the buffer is fully overwritten before it is read, so a correct
17
- `allocUnsafe` + `copy` pair is still reported. The one structural exemption is
18
- `Buffer.allocUnsafe(n).fill(0)`, a parent-node check rather than variable
19
- tracking. Because of that false-positive profile it ships as `warn` in
20
- `recommended` rather than `error` (upstream `security-node` ships its
21
- equivalent off by default).
22
-
23
- ### Patch Changes
24
-
25
- - [#317](https://github.com/ofri-peretz/eslint/pull/317) [`5a8456b`](https://github.com/ofri-peretz/eslint/commit/5a8456b08ffa567be73a66393758ed17805e2fe4) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - `no-ssrf`: recognise `needle` as an HTTP client, so `needle.get(req.query.url)` reports. The verb-first `needle('get', url)` form is still not covered — the rule only inspects the first argument.
26
-
27
- - Updated dependencies [[`09d2951`](https://github.com/ofri-peretz/eslint/commit/09d2951b3ac74efc9ba49b64e9089d66800b16cc)]:
28
- - @interlace/eslint-devkit@1.4.4
29
-
30
- ## 4.5.0
31
-
32
- ### Minor Changes
33
-
34
- - [#310](https://github.com/ofri-peretz/eslint/pull/310) [`28d7898`](https://github.com/ofri-peretz/eslint/commit/28d789896b06dd13ac7c50bcb4aaa36fa5e4be29) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Add `no-timing-unsafe-compare` to the `recommended` preset, restoring CWE-697
35
- coverage.
36
-
37
- `secure-coding/no-insecure-comparison` was removed from every `secure-coding`
38
- preset, with `node-security/no-timing-unsafe-compare` named as the replacement.
39
- But that rule was not in any `recommended` preset, so the practical result was
40
- that **no `recommended` preset anywhere covered CWE-697 timing-unsafe
41
- comparison**, and the migration note pointed users at a rule they would have had
42
- to enable by hand — which the note did not say.
43
-
44
- It enters at `'warn'` rather than `'error'`, matching the precedent already set
45
- by `no-deprecated-buffer` in this preset: adopters shouldn't have CI turn red on
46
- a version bump. Promote to `'error'` on the next major.
47
-
48
- Note the coverage now lives in a different package than before. A project that
49
- installs only `eslint-plugin-secure-coding` and relied on its presets for this
50
- check needs `eslint-plugin-node-security` as well.
51
-
52
- A lock test in `src/index.test.ts` fails if the rule leaves `recommended` again,
53
- since that would silently make the migration note false.
54
-
55
- - [#288](https://github.com/ofri-peretz/eslint/pull/288) [`89bea05`](https://github.com/ofri-peretz/eslint/commit/89bea05c6c48f5f1bdbcc3c87b301d967d962051) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Cut false positives in five security rules, measured against a 1,470-file corpus (webpack `lib/`, lodash, eslint-plugin-import `src/`, and two NestJS boilerplates).
56
-
57
- **`secure-coding/no-hardcoded-credentials` — decide on the value, not the key name.** The rule reported any string in a credential-named slot, so `errors: { password: 'incorrectPassword' }` (an i18n error key) was a CVSS 9.8 finding — 5 of its 10 corpus hits. Detection is now driven by the value's shape: entropy, character-class mix, charset, and a "natural word string" test that rejects identifier- and message-shaped values. A credential-shaped name is still consulted, but only to promote an already-secret-shaped value. Corpus: **10 → 7 findings, and all 7 are true positives** — including two the old logic missed, because a 25-character random `key:` is now found by shape rather than by being on a name allowlist.
58
-
59
- **`secure-coding/no-unsafe-deserialization` — `setTimeout` is not a deserializer.** `await new Promise(resolve => setTimeout(resolve, 1000))` was rated CVSS 9.8 CRITICAL. `setTimeout` / `setInterval` now only report in their implied-`eval` form (string first argument), and calls inside a function named `deserialize` / `unserialize` / `fromJSON` / `fromBuffer` — a class implementing a serialization protocol — are exempt. Corpus: **35 → 4**.
60
-
61
- **`secure-coding/no-graphql-injection` — require real GraphQL syntax.** Any template literal containing a nested brace or the word `type` was a CVSS 9.8 GraphQL injection. Operation and schema keywords must now start a line, schema keywords require a body, and a bare selection set must be the entire string. Concatenations are matched on their reassembled static value rather than on their source text. Corpus: **41 → 0**.
62
-
63
- **`node-security/require-secure-deletion` — only sensitive properties.** The rule fired on every `delete obj.prop`. It now reports only a statically known, sensitive property name (`password`, `token`, `apiKey`, `privateKey`, `sessionId`, …), configurable via the new `additionalSensitiveProperties` option, and understands computed access and optional chaining. Corpus: **25 → 1** (a genuine `delete userDto.oldPassword`).
64
-
65
- **`secure-coding/no-insecure-comparison` — removed from `recommended`, `recommended-strict` and `owasp-top-10`.** It is deprecated in favour of `node-security/no-timing-unsafe-compare`, and its loose-equality half re-reports core `eqeqeq` under a CWE-697 banner — 433 corpus findings, all duplicates. No narrowing fixes that, so the honest change is to stop switching it on for people; it remains exported and available via `strict` or explicit opt-in. Its timing-attack half was also narrowed to match secret keywords on identifier **word segments** instead of substrings of the whole expression text, which stops `if (key === "__non_webpack_require__")` (and `monkey`, `keyword`, `machine`, `author`) from being reported: **443 → 221**.
66
-
67
- ### Patch Changes
68
-
69
- - [#294](https://github.com/ofri-peretz/eslint/pull/294) [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Rewrite `description` and `keywords` on every published package for npm search discovery. npm ranks on name, description, and keywords, and the registry only picks up these fields at publish — so this is metadata-only and takes effect for each package on its next release.
70
-
71
- **Descriptions now lead with the search phrase.** Every one starts `ESLint plugin for <the thing you'd search>` instead of a brand-first or category-first framing, and names the concrete vulnerabilities the plugin actually detects. Three were corrected while doing so:
72
-
73
- - `eslint-plugin-import-next` claimed "100x faster no-cycle detection". No 100x measurement exists: `CLAIMS.md` records **3.1x end-to-end** (8x in pure rule execution) on a 5,483-file React codebase, and the highest number in any benchmark result is 54.9x on the synthetic corpus. The description now states the real-codebase figure.
74
- - `eslint-plugin-secure-coding` claimed SQL injection, XSS and CSRF coverage — none of which are its rules. It now names what it does detect: LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.
75
- - `eslint-plugin-secure-coding` ("89 rules") and `eslint-plugin-react-a11y` ("37 rules") hard-coded rule counts that had drifted from reality. Counts are generated into `interlace-numbers.json`; hand-typed copies are removed rather than corrected.
76
-
77
- **Keywords now match the vocabulary of the plugins that rank.** `eslint-plugin-security`, `eslint-plugin-jsx-a11y`, `eslint-plugin-n` and `eslint-plugin-import` all carry the `eslint` / `eslintplugin` / `eslint-plugin` trio — six of our packages were missing `eslintplugin`, and every one now carries all three plus `static-analysis`, `linting` and `code-quality`. Security plugins add `sast`, `appsec` and `vulnerability`; `node-security` and `secure-coding` also carry `nodesecurity`, the exact keyword `eslint-plugin-security` ranks on. Each plugin gained the CWE identifiers and attack names for what it detects (`cwe-78` command injection, `cwe-22` path traversal, `cwe-89` SQL injection, `cwe-79` XSS, `cwe-347` JWT algorithm confusion, `cwe-352` CSRF, `cwe-943` NoSQL injection), and `node-security` gained the crypto vocabulary it had been missing entirely despite absorbing the crypto rule set (`crypto`, `cryptography`, `weak-hash`, `md5`, `sha1`, `timing-attack`).
78
-
79
- No rule behavior, exports, or configuration changes.
80
-
81
- - [#296](https://github.com/ofri-peretz/eslint/pull/296) [`0c7a208`](https://github.com/ofri-peretz/eslint/commit/0c7a208f568436cc55ac6732641df46e8f44af1f) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Cut two false positives confirmed against the benchmark corpus SAFE fixtures.
82
-
83
- **`node-security/no-ssrf`** — the user-input gate only ran when the URL argument
84
- was a bare identifier, so every other shape reported unconditionally. A Node
85
- options object built from a helper's own parameters —
86
- `https.request({ host, path, method: 'GET' })`, from
87
- `benchmarks/corpus/CWE-444/safe/request-default-parser.js` — was flagged with no
88
- user data anywhere in the flow.
89
-
90
- The gate now applies to every argument shape and requires evidence: a
91
- user-input-named identifier standing as the URL, a read off a request object
92
- (`req` / `request` / `ctx` / `event`), or a template literal or concatenation
93
- interpolating either. Options-object fields count when they are request-sourced,
94
- or when a `url` / `href` / `uri` key holds a user-input-named identifier.
95
-
96
- Newly ignored: options objects and interpolations built purely from locals.
97
- Still reported: `fetch(userUrl)`, `fetch(req.query.url)`,
98
- `https.request({ host: req.query.host })`, ``fetch(`https://${userHost}/x`)``.
99
-
100
- **`secure-coding/no-hardcoded-credentials`** — `secret: '<your-secret-here>'`
101
- from `benchmarks/corpus/CWE-798/safe/test-placeholder-values.js` was reported at
102
- CVSS 9.8. The angle brackets are two character classes, which is all the shape
103
- gate asks for once the slot is credential-named.
104
-
105
- Self-evident placeholders are now skipped: bracketed template slots (`<…>`,
106
- `{{…}}`, `${…}`, `[…]`), placeholder words standing as their own token
107
- (`changeme`, `YOUR_API_KEY`, `example`), and one character repeated
108
- (`xxxxxxxxxxxx`). Whole-token matching only, so a real secret that merely
109
- contains such a substring is unaffected.
110
-
111
- The allowlist applies to non-structural findings only — a JWT, an `sk_live_`
112
- key, or a `postgres://user:pass@host` string still reports whatever words it
113
- contains. Set the new `allowPlaceholders: false` option to restore the previous
114
- behaviour.
115
-
116
- - Updated dependencies [[`e1cdf83`](https://github.com/ofri-peretz/eslint/commit/e1cdf83e3db761907f0ab06f7fc6c1f1da7513a5), [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358)]:
117
- - @interlace/eslint-devkit@1.4.3
118
-
119
- ## 4.4.3
120
-
121
- ### Patch Changes
122
-
123
- - [#269](https://github.com/ofri-peretz/eslint/pull/269) [`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - docs: dual-logo README header (Interlace mark + ESLint mark side by side) and closing Interlace footer — refreshes the README rendered on npmjs.com. No runtime changes.
124
-
125
- - Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
126
- - @interlace/eslint-devkit@1.4.2
127
-
128
- ## 4.4.2
129
-
130
- ### Patch Changes
131
-
132
- - [#252](https://github.com/ofri-peretz/eslint/pull/252) [`d67e395`](https://github.com/ofri-peretz/eslint/commit/d67e3953c2748ad36e6aebe0f24b1d04e518b4d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix Codecov badge showing "unknown" — switch from flag to component URL format
133
-
134
- ## 4.4.1
135
-
136
- ### Patch Changes
137
-
138
- - [#225](https://github.com/ofri-peretz/eslint/pull/225) [`34ff5a8`](https://github.com/ofri-peretz/eslint/commit/34ff5a8e6f5126c5d1c0a524759e0af2b5476b46) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - CI-only: pin all coverage thresholds at 100% (integration target, merges last).
139
-
140
- ## 4.4.0
141
-
142
- ### Minor Changes
143
-
144
- - [#190](https://github.com/ofri-peretz/eslint/pull/190) [`6bb476d`](https://github.com/ofri-peretz/eslint/commit/6bb476d232f85da8201b08d0a199c9267c3499e5) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - feat(node-security): add `no-dynamic-algorithm-selection` (CWE-327)
145
-
146
- Disallow dynamic (non-literal) algorithm names in Node.js crypto functions.
147
- A runtime-selected algorithm argument can allow a downgrade to a broken or
148
- risky cryptographic algorithm (CWE-327: Use of a Broken or Risky
149
- Cryptographic Algorithm). AST-structural — flags non-literal algorithm
150
- arguments to the crypto APIs.
151
-
152
- ### Patch Changes
153
-
154
- - [#215](https://github.com/ofri-peretz/eslint/pull/215) [`f42ea93`](https://github.com/ofri-peretz/eslint/commit/f42ea935555a558627dd61d1b013cd8509943c89) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Align `no-dynamic-algorithm-selection`'s `meta.docs.cvss` (7.4) to the CVSS its
155
- finding actually emits. The rule's message carries `CWE-327` and sets no
156
- per-message `cvss`, so it inherits `CWE_MAPPING['CWE-327']` = 7.5 via
157
- `enrichFromCWE` — docs now match the emitted value. Surfaced by the
158
- cross-plugin `security-cvss-docs-consistency.lock.test.ts` lock (added in [#213](https://github.com/ofri-peretz/eslint/issues/213)),
159
- which turned main red when this rule landed concurrently with the CVSS sweep.
160
- Documentation-metadata only; no emitted finding changes.
161
-
162
- - [#213](https://github.com/ofri-peretz/eslint/pull/213) [`391dbe6`](https://github.com/ofri-peretz/eslint/commit/391dbe6b39f78d549379218567cb959649f8c614) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Align every security rule's `meta.docs.cvss` to the CVSS its finding actually
163
- emits. The emitted machine-readable message sources its `CVSS:x` from
164
- `CWE_MAPPING` via `formatLLMMessage` → `enrichFromCWE`, but the static
165
- `meta.docs.cvss` documentation field had drifted on 45 rules across these 7
166
- plugins — e.g. `no-hardcoded-credentials` documented `9.5` while emitting
167
- `CVSS:9.8` (the value the published article and SARIF/LLM consumers already
168
- read).
169
-
170
- This corrects the **documentation metadata only** — no emitted finding changes.
171
- Locked by `security-cvss-docs-consistency.lock.test.ts` (cross-plugin: every
172
- security rule's `meta.docs.cvss` must equal the CVSS it emits), the
173
- `no-hardcoded-credentials` rule lock (real ESLint `Linter` emission), and a
174
- devkit `enrichFromCWE` contract test pinning `CWE-798 → 9.8`.
175
-
176
- Follow-up (not in scope): 50 security rules document a CVSS that never appears
177
- in any emitted message (their messages carry no CWE), and several rules emit the
178
- generic CWE score where a rule-specific score may be warranted — both change
179
- emitted output and are separate decisions.
180
-
181
- ## 4.3.0
182
-
183
- ### Minor Changes
184
-
185
- - [#148](https://github.com/ofri-peretz/eslint/pull/148) [`82718c2`](https://github.com/ofri-peretz/eslint/commit/82718c282895710d42c36d4679fb24d47f1c35c7) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - feat(node-security): add `no-math-random-crypto` (CWE-338)
186
-
187
- Detects `Math.random()` used in cryptographic contexts (tokens, keys, secrets,
188
- salts, IVs, session IDs) and steers to `crypto.randomBytes()` / `crypto.randomUUID()`.
189
-
190
- This was the one cryptography rule that the deprecated `eslint-plugin-crypto`
191
- shipped but had **not** been carried into `node-security` during the 2026-05
192
- consolidation — so `eslint-plugin-crypto`'s deprecation notice ("node-security
193
- includes all cryptography rules") was previously inaccurate. It is now true.
194
-
195
- Added to the `recommended` preset as `error`. The detection is return/assignment
196
- context-aware (matches `crypto`-named variables, properties, and function
197
- returns) so benign uses like a Fisher-Yates shuffle into a non-crypto variable
198
- do not false-positive — verified against the fn-fp benchmark (40/40 detection,
199
- 0 false positives with the crypto-free fleet).
200
-
201
- ### Patch Changes
202
-
203
- - [#144](https://github.com/ofri-peretz/eslint/pull/144) [`8843ce7`](https://github.com/ofri-peretz/eslint/commit/8843ce7fbb465caad161b97032467b3a37a49319) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: ILB-Wild FP reduction + doc examples + doc-test-alignment scanner fixes
204
-
205
- **`no-unlimited-resource-allocation` — FP reduction (430 Edge FPs)**
206
- - Skip loop-allocation reporting when the first argument is a numeric literal (e.g. `Buffer.alloc(1024)` inside a loop is statically bounded, not a risk)
207
- - Skip `Array.isArray`, `Array.from`, `Array.of` calls in the `alloc/Array` pattern check (these don't allocate unbounded memory)
208
-
209
- **`no-hardcoded-credentials` — FP reduction (~280 Edge FPs)**
210
- - Extended test-file skip to cover `.fixture.`, `.mock.`, `__mocks__/`, `/tests/`, `/fixtures/`, `/mocks/` paths
211
- - Skip string literals that are fallback values in `process.env.X || 'fallback'` expressions — the secret lives in the environment, the string is only a dev-mode default
212
-
213
- **Doc examples — 4 rules now have ❌ Incorrect examples**
214
- - `lambda-security/no-missing-authorization-check`
215
- - `lambda-security/no-overly-permissive-iam-policy`
216
- - `node-security/prefer-native-crypto` (renamed non-standard `### ❌ Third-Party (Flagged)` to `### ❌ Incorrect`)
217
- - `vercel-ai-security/require-tool-confirmation` (replaced placeholder with a real tested example)
218
-
219
- **`ilb-doc-test-alignment` scanner fixes**
220
- - Accept both `## ❌` and `### ❌` headings (docs use H3 under an H2 `## Examples` section; was only finding H2)
221
- - Slice from end-of-line rather than end-of-regex-match (prevents `## ❌ Incorrect Code` from leaving a partial heading in the parsed section)
222
-
223
- Result: `ilb:doc-test-alignment` → 206 ok, 0 doc has no ❌ examples (was 165 missing).
224
-
225
- - [#141](https://github.com/ofri-peretz/eslint/pull/141) [`38ab670`](https://github.com/ofri-peretz/eslint/commit/38ab670a0221684f4fd3d5dc3c05ddec7458ca2b) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: remove false `meta.fixable: 'code'` declarations from 21 rules that had no `fix()` function
226
-
227
- Rules that declared `fixable: 'code'` in their ESLint meta without an actual `fix()` implementation would show the ⚡ auto-fix icon in editors and CI formatters but apply no change when `--fix` was run. This patch removes the misleading declaration from:
228
- - `browser-security/no-clickjacking`
229
- - `import-next/first`, `named`, `no-barrel-import`, `no-import-module-exports`, `no-namespace`
230
- - `node-security/no-buffer-overread`, `no-unsafe-dynamic-require`, `no-zip-slip`
231
- - `react-features/react-no-inline-functions`
232
- - `reliability/no-jsdoc-terminator-in-example` (uses `suggest`, not auto-fix; corrected to `hasSuggestions: true` only)
233
- - `secure-coding/no-directive-injection`, `no-electron-security-issues`, `no-graphql-injection`, `no-improper-sanitization`, `no-improper-type-validation`, `no-ldap-injection`, `no-unchecked-loop-condition`, `no-unlimited-resource-allocation`, `no-weak-password-recovery`, `no-xpath-injection`
234
-
235
- - [#186](https://github.com/ofri-peretz/eslint/pull/186) [`edf208d`](https://github.com/ofri-peretz/eslint/commit/edf208d67ac2357312c97d8964fcf6a462e407eb) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Consolidation cleanup — no rule behavior change:
236
- - **react-features**: the README rules table now lists the 8 `componentApi`
237
- preset rules. The README generator (`sync-readme-rules.ts`) and the
238
- `plugin-rule-source-drift` validator now recurse into nested
239
- `docs/rules/<category>/` subfolders, so every documented rule is advertised
240
- consistently (previously the nested componentApi docs were silently dropped,
241
- which an earlier `readme` exception had papered over — that exception is now
242
- removed in favour of the real fix).
243
- - **node-security**: remove the orphaned `no-pii-in-logs` rule source — the rule
244
- was migrated to `eslint-plugin-secure-coding` and is no longer exported here;
245
- the dead source was still compiling into `dist`.
246
- - **import-next**: restore the `no-cycle` unit test after [#180](https://github.com/ofri-peretz/eslint/issues/180)'s SCC refactor
247
- (`computeSCCsFromFile` + `findShortestCyclePath` are now bridged in the mock).
248
-
249
- Also fixes `scripts/ilb-plugin-scope-audit.ts` to stop mis-reading config-preset
250
- keys (`'recommended-strict': {`) as rules.
251
-
252
- - [#148](https://github.com/ofri-peretz/eslint/pull/148) [`82718c2`](https://github.com/ofri-peretz/eslint/commit/82718c282895710d42c36d4679fb24d47f1c35c7) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - feat+fix: ILB-Wild FP reduction + two new quality rules
253
-
254
- **`no-unsafe-deserialization` FP reduction (~112 FPs)**
255
- - Track `fs.readFileSync('literal')` calls in `literalPathFileVars` — a file read with a
256
- hardcoded path (bundled config) is not user-controlled input for safe deserializers
257
- (`JSON.parse`, schema-validating parsers). `eval()` still fires even on literal-path reads.
258
-
259
- **`no-buffer-overread` FP reduction (~129 FPs)**
260
- - Remove `b` (single-char, too broad) and `chunk` (too common for array chunks) from the
261
- Buffer alias heuristic — `isBufferType` now only matches `buf` and `bytes` by name,
262
- reducing false matches on non-Buffer variables.
263
-
264
- **New rule: `modernization/prefer-template-literal`**
265
- - Flags `"string " + variable` concatenation and suggests the equivalent template literal.
266
- - Auto-fix produces the correct `` `string ${variable}` `` replacement.
267
- - Pure string literal chains (`"a" + "b"`) and numeric addition are not flagged.
268
- - Closes P2 quality FN `prob_string_concat` in the ILB-Arena-Quality bench.
269
-
270
- **New rule: `modularity/no-mutable-exports`**
271
- - Flags `export let` and `export var` — module exports should be immutable `const`
272
- bindings so all importers share a stable reference.
273
- - Auto-fix replaces `let`/`var` with `const`.
274
- - Closes P2 quality FN `prob_mutable_export` in the ILB-Arena-Quality bench.
275
-
276
- - Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
277
- - @interlace/eslint-devkit@1.4.1
278
-
279
- ## [4.1.0] - 2026-05-03
280
-
281
- ### Added
282
-
283
- - New rule `no-deprecated-buffer` — flags use of the deprecated `Buffer()` constructor (Node.js security advisory; `Buffer.from`/`Buffer.alloc` should be used instead). Enabled in the `recommended` preset at `warn` to avoid breaking adopters with legacy `Buffer()` calls; will be promoted to `error` in the next major.
284
-
285
- ### Bug Fixes
286
-
287
- - `no-zip-slip`: removed redundant dangerous-destination check from the literal handler. Extraction-call handler already reports `dangerousArchiveDestination`; the literal-side check was producing duplicate errors and (separately) firing on unrelated calls like `fs.readFileSync('/etc/app/config')`.
288
- - `lock-file`, `detect-child-process`: minor refinements (see source diff).
289
-
290
- ## [4.0.4] - 2026-02-08
291
-
292
- ### Bug Fixes
293
-
294
- - align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
295
- - resolve all benchmark FN/FP across security rules ([45ffb791](https://github.com/ofri-peretz/eslint/commit/45ffb791))
296
- - **rules:** reduce false positives across security rules ([c192233c](https://github.com/ofri-peretz/eslint/commit/c192233c))
297
-
298
- ### Documentation
299
-
300
- - fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
301
-
302
- ### ❤️ Thank You
303
-
304
- - Ofri Peretz
305
-
306
- ## [4.0.3] - 2026-02-06
307
-
308
- ### Bug Fixes
309
-
310
- - ⚠️ **rules:** reduce false positives across security rules ([af4ca0e7](https://github.com/ofri-peretz/eslint/commit/af4ca0e7))
311
- - align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
312
-
313
- ### ⚠️ Breaking Changes
314
-
315
- - **rules:** Some previously flagged patterns are now correctly allowed ([af4ca0e7](https://github.com/ofri-peretz/eslint/commit/af4ca0e7))
316
-
317
- ### ❤️ Thank You
318
-
319
- - Ofri Peretz
320
-
321
- ## [4.0.2] - 2026-02-02
322
-
323
- This was a version bump only for eslint-plugin-node-security to align it with other projects, there were no code changes.
324
-
325
- # Changelog
326
-
327
- All notable changes to `eslint-plugin-node-security` will be documented in this file.
328
-
329
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
330
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
331
-
332
- ### Documentation
333
-
334
- - 📘 Launched new documentation site: [eslint.interlace.tools](https://eslint.interlace.tools/)
335
- - 📝 Achieved 100% documentation parity (both .md and .mdx files)
336
-
337
- ## [4.0.1] - 2026-02-02
338
-
339
- This was a version bump only for eslint-plugin-node-security to align it with other projects, there were no code changes.
340
-
341
- ## [4.0.0] - 2026-02-02
342
-
343
- This was a version bump only for eslint-plugin-node-security to align it with other projects, there were no code changes.
344
-
345
- ## [1.0.0] - 2026-01-26
346
-
347
- ### Added
348
-
349
- - Initial stable release with 31 Node.js security rules
350
- - LLM-optimized error messages with CWE references and OWASP mapping
351
- - 100% test coverage across all rules
352
- - ESLint 8 and ESLint 9 flat config support
353
- - TypeScript type definitions for all rule options
354
-
355
- ### Rule Categories
356
-
357
- #### Cryptography Rules (12)
358
-
359
- - `no-sha1-hash` - Disallow SHA-1 for security-sensitive operations (CWE-328)
360
- - `no-weak-hash-algorithm` - Disallow MD5, SHA-1 for cryptographic hashing (CWE-328)
361
- - `no-ecb-mode` - Disallow ECB mode for block ciphers (CWE-327)
362
- - `no-static-iv` - Disallow static initialization vectors (CWE-329)
363
- - `no-insecure-key-derivation` - Require secure key derivation functions (CWE-916)
364
- - `no-insecure-rsa-padding` - Require OAEP padding for RSA (CWE-780)
365
- - `no-self-signed-certs` - Detect disabled TLS certificate validation (CWE-295)
366
- - `no-timing-unsafe-compare` - Require timing-safe comparison for secrets (CWE-208)
367
- - `no-cryptojs` - Prefer native crypto over CryptoJS (CWE-327)
368
- - `no-cryptojs-weak-random` - Disallow CryptoJS weak random (CWE-338)
369
- - `no-deprecated-cipher-method` - Disallow deprecated crypto methods (CWE-327)
370
- - `prefer-native-crypto` - Prefer Node.js native crypto module
371
-
372
- #### File System Rules (7)
373
-
374
- - `no-path-traversal` - Prevent path traversal attacks (CWE-22)
375
- - `no-unsafe-file-permissions` - Enforce secure file permissions (CWE-732)
376
- - `no-symlink-attacks` - Prevent symlink-based attacks (CWE-59)
377
- - `require-file-validation` - Require file type validation (CWE-434)
378
- - `no-temp-file-exposure` - Prevent temp file security issues (CWE-377)
379
- - `no-hardcoded-paths` - Prevent hardcoded sensitive paths (CWE-426)
380
- - `require-safe-path-join` - Require path.join for path construction (CWE-22)
381
-
382
- #### Process & Shell Rules (6)
383
-
384
- - `no-child-process-injection` - Prevent command injection (CWE-78)
385
- - `no-shell-exec` - Disallow shell: true in spawn options (CWE-78)
386
- - `no-env-exposure` - Prevent environment variable exposure (CWE-214)
387
- - `require-process-sanitization` - Require input sanitization for process args (CWE-88)
388
- - `no-unsafe-exec` - Disallow exec with dynamic input (CWE-78)
389
- - `no-eval-alternatives` - Disallow Function constructor, vm runInContext (CWE-95)
390
-
391
- #### Network Rules (6)
392
-
393
- - `require-tls-verification` - Require TLS certificate validation (CWE-295)
394
- - `no-dns-rebinding` - Prevent DNS rebinding attacks (CWE-350)
395
- - `no-ssrf` - Prevent Server-Side Request Forgery (CWE-918)
396
- - `require-https` - Require HTTPS for external requests (CWE-319)
397
- - `no-unsafe-redirect` - Prevent open redirects (CWE-601)
398
- - `require-host-validation` - Require host header validation (CWE-20)
399
-
400
- ### Presets
401
-
402
- - `recommended` - Balanced security for Node.js applications
403
- - `strict` - All rules as errors
404
- - `crypto` - Cryptography-focused subset
405
- - `filesystem` - File system security subset
406
- - `network` - Network security subset
407
-
408
- ### Features
409
-
410
- - Comprehensive detection patterns for Node.js core modules
411
- - Support for popular libraries (fs-extra, glob, rimraf)
412
- - Auto-fix capabilities where safe
413
- - ESLint MCP integration for AI assistants
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,uEAAkE;AAClE,qFAA+E;AAC/E,2FAAoF;AACpF,iFAA2E;AAC3E,mEAA8D;AAC9D,uEAAkE;AAClE,2EAAqE;AACrE,6EAAwE;AACxE,qDAAgD;AAChD,+EAAyE;AACzE,6EAAsE;AACtE,6CAAyC;AACzC,mEAA8D;A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C,EAAE,OAAO;IAErD,8BAA8B;IAC9B,sCAAsC,EAAE,OAAO;IAC/C,wCAAwC,EAAE,OAAO;IACjD,4BAA4B,EAAE,OAAO;IACrC,2BAA2B,EAAE,OAAO;IACpC,qCAAqC,EAAE,OAAO;IAC9C,2BAA2B,EAAE,OAAO;CACrC,CAAC;AAEW,QAAA,OAAO,GAA+C;IACjE,WAAW,EAAE;QACX,OAAO,EAAE;YACP,eAAe,EAAE,cAAM;SACxB;QACD,KAAK,EAAE,gBAAgB;KACa;IACtC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,eAAe,EAAE,cAAM;SACxB;QACD,KAAK,EAAE,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,IAAI,CAAC,aAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;YACnC,iBAAiB,QAAQ,EAAE;YAC3B,OAAO;SACR,CAAC,CACH;KACmC;CACvC,CAAC;AAEF,kBAAe,cAAM,CAAC"}
package/src/oxlint.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/oxlint.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AAEH,mCAAiC;AAEjC,iBAAS,cAAM,CAAC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: detect-child-process
8
- * Detects instances of child_process & non-literal exec() calls
9
- * LLM-optimized with comprehensive command injection prevention guidance
10
- *
11
- * @see https://owasp.org/www-community/attacks/Command_Injection
12
- * @see https://cwe.mitre.org/data/definitions/78.html
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'childProcessCommandInjection' | 'useExecFile' | 'useSpawn' | 'useSaferLibrary' | 'validateInput' | 'useShellFalse' | 'strategyValidate' | 'strategySanitize' | 'strategyRestrict';
16
- export interface Options {
17
- /** Allow exec() with literal strings. Default: false (stricter) */
18
- allowLiteralStrings?: boolean;
19
- /** Allow spawn() with literal arguments. Default: false (stricter) */
20
- allowLiteralSpawn?: boolean;
21
- /** Additional child_process methods to check */
22
- additionalMethods?: string[];
23
- /** Strategy for fixing command injection: 'validate', 'sanitize', 'restrict', or 'auto' */
24
- strategy?: 'validate' | 'sanitize' | 'restrict' | 'auto';
25
- }
26
- type RuleOptions = [Options?];
27
- /**
28
- * Command execution patterns and their security implications
29
- */
30
- interface CommandPattern {
31
- method: string;
32
- dangerous: boolean;
33
- vulnerability: 'command-injection' | 'argument-injection' | 'path-injection';
34
- safeAlternatives: string[];
35
- example: {
36
- bad: string;
37
- good: string[];
38
- };
39
- effort: string;
40
- }
41
- /**
42
- * Generate refactoring steps based on the pattern.
43
- *
44
- * Module-scope (rather than inline in `create()`) so the `default` branch —
45
- * unreachable through COMMAND_PATTERNS, which only contains methods with
46
- * dedicated cases — is directly unit-testable.
47
- */
48
- export declare const generateRefactoringSteps: (pattern: CommandPattern) => string;
49
- export type { CommandPattern };
50
- export declare const detectChildProcess: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
51
- name: string;
52
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rules/detect-child-process/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAWH,4DAA0F;AAC1F,4DAAsD;AAyCtD,MAAM,gBAAgB,GAAqB;IACzC;QACE,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,mBAAmB;QAClC,gBAAgB,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;QACvC,OAAO,EAAE;YACP,uDAAuD;YACvD,GAAG,EAAE,8BAA8B;YACnC,IAAI,EAAE;gBACJ,yDAAyD;gBACzD,sDAAsD;aACvD;SACF;QACD,MAAM,EAAE,eAAe;KACxB;IACD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EAAE,qBAAqB;YACrC,iBAAiB,EAAE,uBAAuB;YAC1C,kBAAkB,EAAE,wBAAwB;SAC7C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: detect-eval-with-expression
8
- * Detects eval(variable) which can allow an attacker to run arbitrary code
9
- * LLM-optimized with comprehensive fix guidance and security context
10
- *
11
- * @see https://owasp.org/www-community/attacks/Code_Injection
12
- * @see https://cwe.mitre.org/data/definitions/95.html
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'evalWithExpression' | 'useJsonParse' | 'useObjectAccess' | 'useTemplateLiteral' | 'useFunctionConstructor' | 'useSaferAlternative' | 'strategyRemove' | 'strategyRefactor' | 'strategyValidate';
16
- export interface Options {
17
- /** Allow eval with literal strings. Default: false (stricter) */
18
- allowLiteralStrings?: boolean;
19
- /** Additional functions to treat as eval-like */
20
- additionalEvalFunctions?: string[];
21
- /** Strategy for fixing eval usage: 'remove', 'refactor', 'validate', or 'auto' */
22
- strategy?: 'remove' | 'refactor' | 'validate' | 'auto';
23
- }
24
- type RuleOptions = [Options?];
25
- /**
26
- * Pattern categories and their safe alternatives
27
- */
28
- interface EvalPattern {
29
- pattern: string;
30
- category: 'json' | 'math' | 'template' | 'object' | 'dynamic' | 'other';
31
- safeAlternative: string;
32
- example: {
33
- bad: string;
34
- good: string;
35
- };
36
- effort: string;
37
- }
38
- /**
39
- * Generate refactoring steps based on pattern.
40
- * Module-scope so it is directly unit-testable (Layer-2).
41
- */
42
- export declare const generateRefactoringSteps: (pattern: EvalPattern | null) => string;
43
- export declare const detectEvalWithExpression: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
44
- name: string;
45
- };
46
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rules/detect-eval-with-expression/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAWH,4DAA0E;AAC1E,4DAAsD;AAqCtD,MAAM,aAAa,GAAkB;IACnC;QACE,OAAO,EAAE,4BAA4B;QACrC,QAAQ,EAAE,MAAM;QAChB,eAAe,EAAE,cAAc;QAC/B,OAAO,EAAE;YACP,GAAG,EAAE,uCAAuC;YAC5C,IAAI,EAAE,6CAA6C;SACpD;QACD,MAAM,EAAE,WAAW;KACpB;IACD;QACE,OAAO,EAAE,6BAA6B;QACtC,QAAQ,EAAE,MAAM;QAChB,eAAe,EAAE,uCAAuC;QACxD,OAAO,EAAE;YACP,GAAG,EAAE,gDAAgD;YACrD,IAAI,EAAE,8EAA8E;SACrF;QACD,MAAM,EAAE,WAAW;KACpB;IACD;QACE,OAAO,EAAE,4BAA4B;QACrC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,sCAAsC;QACvD,OAAO,EAAE;YACP,GAAG,EAAE,qCAAqC;YAC1C,uDAAuD;YACvD,IAAI,EAAE,wCAAwC;SAC/C;QACD,MAAM,EAAE,WAAW;KACpB;IACD;QACE,OAAO,EAAE,+BAA+B;QACxC,QAAQ,EAAE,QAAQ;QAClB,eAAe,EAAE,+BAA+B;QAChD,OAAO,EAAE;YACP,GAAG,EAAE,2BAA2B;YAChC,IAAI,EAAE,yFAAyF;SAChG;QACD,MAAM,EAAE,WAAW;KACpB;CACF,CAAC;AAEF;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CAAC,OAA2B,EAAU,EAAE;IAC9E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,oCAAoC;YACpC,mDAAmD;YACnD,gEAAgE;YAChE,uDAAuD;YACvD,sCAAsC;SACvC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,MAAM;YACT,OAA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