@fabriziosalmi/slopless 1.4.1

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -0
  3. package/dist/engine/api.d.ts +16 -0
  4. package/dist/engine/api.js +543 -0
  5. package/dist/index.d.ts +122 -0
  6. package/dist/index.js +590 -0
  7. package/package.json +59 -0
  8. package/rules/VBC-001.yaml +33 -0
  9. package/rules/VBC-002.yaml +13 -0
  10. package/rules/VBC-003.yaml +36 -0
  11. package/rules/VBC-004.yaml +33 -0
  12. package/rules/VBC-005.yaml +24 -0
  13. package/rules/VBC-006.yaml +16 -0
  14. package/rules/VBC-007.yaml +28 -0
  15. package/rules/VBC-008.yaml +21 -0
  16. package/rules/VBC-009.yaml +24 -0
  17. package/rules/VBC-010.yaml +24 -0
  18. package/rules/VBC-011.yaml +21 -0
  19. package/rules/VBC-012.yaml +21 -0
  20. package/rules/VBC-013.yaml +17 -0
  21. package/rules/VBC-014.yaml +15 -0
  22. package/rules/VBC-015.yaml +40 -0
  23. package/rules/VBC-016.yaml +21 -0
  24. package/rules/VBC-017.yaml +23 -0
  25. package/rules/VBC-018.yaml +19 -0
  26. package/rules/VBC-019.yaml +42 -0
  27. package/rules/VBC-020.yaml +22 -0
  28. package/rules/VBC-021.yaml +22 -0
  29. package/rules/VBC-022.yaml +21 -0
  30. package/rules/VBC-023.yaml +22 -0
  31. package/rules/VBC-024.yaml +26 -0
  32. package/rules/VBC-025.yaml +13 -0
  33. package/rules/VBC-026.yaml +17 -0
  34. package/rules/VBC-027.yaml +27 -0
  35. package/rules/VBC-028.yaml +18 -0
  36. package/rules/VBC-029.yaml +22 -0
  37. package/rules/VBC-030.yaml +22 -0
  38. package/rules/VBC-032.yaml +20 -0
  39. package/rules/VBC-033.yaml +26 -0
  40. package/rules/VBC-034.yaml +41 -0
  41. package/rules/VBC-035.yaml +30 -0
  42. package/rules/VBC-039.yaml +18 -0
  43. package/rules/VBC-042.yaml +26 -0
  44. package/rules/VBC-045.yaml +13 -0
  45. package/rules/VBC-046.yaml +13 -0
  46. package/rules/VBC-048.yaml +23 -0
  47. package/rules/VBC-049.yaml +19 -0
  48. package/rules/VBC-051.yaml +23 -0
  49. package/rules/VBC-052.yaml +19 -0
  50. package/rules/VBC-053.yaml +19 -0
  51. package/rules/VBC-054.yaml +29 -0
  52. package/rules/VBC-056.yaml +28 -0
  53. package/rules/VBC-057.yaml +18 -0
  54. package/rules/VBC-058.yaml +18 -0
  55. package/rules/VBC-059.yaml +21 -0
  56. package/rules/VBC-063-B.yaml +15 -0
  57. package/rules/VBC-063.yaml +18 -0
  58. package/rules/VBC-065.yaml +33 -0
  59. package/rules/VBC-066.yaml +16 -0
  60. package/rules/VBC-068.yaml +21 -0
  61. package/rules/VBC-070.yaml +19 -0
  62. package/rules/VBC-077.yaml +35 -0
  63. package/rules/VBC-079.yaml +18 -0
  64. package/rules/VBC-080.yaml +18 -0
  65. package/rules/VBC-084.yaml +22 -0
  66. package/rules/VBC-086.yaml +22 -0
  67. package/rules/VBC-090.yaml +28 -0
  68. package/rules/VBC-096.yaml +19 -0
  69. package/rules/VBC-097.yaml +21 -0
  70. package/rules/VBC-098.yaml +18 -0
  71. package/rules/VBC-101.yaml +23 -0
  72. package/rules/VBC-102.yaml +20 -0
  73. package/rules/VBC-103.yaml +35 -0
  74. package/rules/VBC-104.yaml +24 -0
  75. package/rules/VBC-106.yaml +14 -0
  76. package/rules/VBC-112.yaml +20 -0
  77. package/rules/VBC-113.yaml +19 -0
  78. package/rules/VBC-117.yaml +21 -0
  79. package/rules/VBC-123.yaml +29 -0
  80. package/rules/VBC-131.yaml +20 -0
  81. package/rules/VBC-150.yaml +27 -0
  82. package/rules/VBC-153.yaml +21 -0
  83. package/rules/VBC-158.yaml +16 -0
  84. package/rules/VBC-161.yaml +27 -0
  85. package/rules/VBC-172.yaml +25 -0
  86. package/rules/VBC-197.yaml +22 -0
  87. package/rules/VBC-201.yaml +35 -0
  88. package/rules/VBC-206.yaml +19 -0
  89. package/rules/VBC-208.yaml +27 -0
  90. package/rules/VBC-212.yaml +19 -0
  91. package/rules/VBC-215.yaml +24 -0
  92. package/rules/VBC-305.yaml +20 -0
  93. package/rules/VBC-324.yaml +24 -0
  94. package/rules/VBC-334.yaml +23 -0
  95. package/rules/VBC-338.yaml +32 -0
  96. package/rules/VBC-340.yaml +22 -0
  97. package/rules/VBC-344.yaml +19 -0
  98. package/rules/VBC-347.yaml +21 -0
  99. package/rules/VBC-348.yaml +19 -0
  100. package/rules/VBC-385.yaml +21 -0
  101. package/rules/VBC-398.yaml +22 -0
  102. package/rules/VBC-401.yaml +12 -0
  103. package/rules/VBC-414.yaml +23 -0
  104. package/rules/VBC-421.yaml +20 -0
  105. package/rules/VBC-501.yaml +18 -0
  106. package/rules/VBC-502.yaml +23 -0
  107. package/rules/VBC-503.yaml +18 -0
  108. package/rules/VBC-504.yaml +20 -0
  109. package/rules/VBC-800.yaml +17 -0
  110. package/rules/VBC-901.yaml +48 -0
  111. package/rules/VBC-902.yaml +19 -0
  112. package/rules/VBC-903.yaml +17 -0
  113. package/rules/VBC-904.yaml +21 -0
  114. package/rules/VBC-905.yaml +17 -0
  115. package/rules/VBC-906.yaml +29 -0
  116. package/rules/VBC-907.yaml +24 -0
  117. package/rules/VBC-908.yaml +22 -0
  118. package/rules/VBC-909.yaml +21 -0
  119. package/rules/VBC-910.yaml +18 -0
  120. package/rules/VBC-911.yaml +21 -0
  121. package/rules/VBC-913.yaml +30 -0
  122. package/rules/VBC-914.yaml +31 -0
  123. package/rules/VBC-915.yaml +19 -0
  124. package/rules/VBC-916.yaml +24 -0
  125. package/rules/VBC-917.yaml +21 -0
  126. package/rules/VBC-918.yaml +22 -0
  127. package/rules/VBC-920.yaml +20 -0
  128. package/rules/VBC-921.yaml +45 -0
  129. package/rules/VBC-922.yaml +15 -0
  130. package/rules/VBC-923.yaml +15 -0
  131. package/rules/VBC-924.yaml +12 -0
  132. package/rules/VBC-925.yaml +14 -0
  133. package/rules/VBC-926.yaml +14 -0
  134. package/rules/VBC-927.yaml +24 -0
  135. package/rules/VBC-928.yaml +25 -0
  136. package/rules/VBC-929.yaml +21 -0
  137. package/rules/VBC-930.yaml +16 -0
  138. package/rules/VBC-931.yaml +16 -0
  139. package/rules/VBC-932.yaml +16 -0
  140. package/rules/VBC-933.yaml +28 -0
  141. package/rules/VBC-934.yaml +24 -0
  142. package/rules/VBC-935.yaml +26 -0
  143. package/rules/VBC-936.yaml +24 -0
  144. package/rules/VBC-937.yaml +24 -0
  145. package/rules/VBC-938.yaml +23 -0
  146. package/rules/VBC-939.yaml +23 -0
  147. package/rules/VBC-940.yaml +30 -0
  148. package/rules/VBC-941.yaml +28 -0
  149. package/rules/VBC-942.yaml +23 -0
  150. package/rules/VBC-943.yaml +22 -0
  151. package/rules/VBC-944.yaml +26 -0
  152. package/rules/VBC-945.yaml +33 -0
  153. package/rules/VBC-946.yaml +26 -0
  154. package/rules/VBC-947.yaml +22 -0
  155. package/rules/VBC-948.yaml +26 -0
@@ -0,0 +1,28 @@
1
+ id: VBC-941
2
+ name: missing-input-sanitization
3
+ severity: warning
4
+ category: security
5
+ tags:
6
+ - security
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ dangerouslySetInnerHTML\s*=\s*\{\{[^}]*__html\s*:\s*(?!\s|['\"`])|\.outerHTML\s*=(?!=)|\.insertAdjacentHTML\s*\(\s*[^,]+,\s*(?!\s|['\"`])
11
+ file_types:
12
+ - js
13
+ - ts
14
+ - jsx
15
+ - tsx
16
+ supersedes:
17
+ - VBC-070
18
+ message: >-
19
+ Unsanitized HTML sink at line {line}. dangerouslySetInnerHTML, outerHTML and insertAdjacentHTML
20
+ all bypass framework escaping. Sanitize with a library such as DOMPurify before assigning
21
+ untrusted markup.
22
+ tests:
23
+ fire:
24
+ - '<div dangerouslySetInnerHTML={{ __html: userHtml }} />'
25
+ - el.outerHTML = markup;
26
+ quiet:
27
+ - '<div dangerouslySetInnerHTML={{ __html: "<b>static</b>" }} />'
28
+ - el.textContent = text;
@@ -0,0 +1,23 @@
1
+ id: VBC-942
2
+ name: missing-access-control
3
+ severity: warning
4
+ category: security
5
+ tags:
6
+ - security
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ (?:router|app)\.(?:get|post|put|delete|patch)\s*\(\s*['\"][^'\"]+['\"]\s*,\s*(?:async\s+)?\(?\s*(?:req|request)\b[^)]*\)?\s*(?:=>|\{)
11
+ file_types:
12
+ - js
13
+ - ts
14
+ message: >-
15
+ Route handler at line {line} may be missing authentication middleware. AI-generated route
16
+ handlers frequently omit auth guards. Ensure every non-public endpoint is protected with
17
+ authentication and authorization middleware before the handler runs.
18
+ tests:
19
+ fire:
20
+ - router.get('/users', async (req, res) => res.json(users));
21
+ quiet:
22
+ - >-
23
+ router.get('/users', requireAuth, async (req, res) => res.json(users));
@@ -0,0 +1,22 @@
1
+ id: VBC-943
2
+ name: ignored-catch-variable
3
+ severity: warning
4
+ category: clean-code
5
+ tags:
6
+ - clean-code
7
+ - ai-error
8
+ match:
9
+ regex: catch\s*\(\s*_[a-zA-Z]?\s*\)\s*\{
10
+ file_types:
11
+ - js
12
+ - ts
13
+ message: >-
14
+ Catch clause with ignored error variable at line {line}. Using '_' as the catch binding
15
+ signals the exception is intentionally discarded. AI-generated code often silently suppresses
16
+ errors this way, hiding failures in production. Either log the error, re-throw with context,
17
+ or add an explicit comment explaining why suppression is safe here.
18
+ tests:
19
+ fire:
20
+ - try { risky(); } catch (_e) { fallback(); }
21
+ quiet:
22
+ - try { risky(); } catch (error) { report(error); }
@@ -0,0 +1,26 @@
1
+ id: VBC-944
2
+ name: xss-href-injection
3
+ severity: error
4
+ category: security
5
+ tags:
6
+ - security
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ href\s*=\s*\{[^}]*\+|href\s*=\s*[`'"][^`'"]*\$\{|href\s*=\s*\{\s*`[^`]*\$\{
11
+ scan: all
12
+ file_types:
13
+ - js
14
+ - ts
15
+ - jsx
16
+ - tsx
17
+ - html
18
+ message: >-
19
+ Dynamic href constructed with string interpolation at line {line}. If the value originates
20
+ from user input or an untrusted source, this is a javascript: URL injection vector. Validate
21
+ that URLs begin with http(s):// or are relative paths before assigning to href.
22
+ tests:
23
+ fire:
24
+ - const link = `href="${untrusted}"`;
25
+ quiet:
26
+ - <a href="/static/page">page</a>
@@ -0,0 +1,33 @@
1
+ id: VBC-945
2
+ name: ai-generated-placeholder-comment
3
+ severity: warning
4
+ category: clean-code
5
+ tags:
6
+ - clean-code
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ //\s*(?:TODO|FIXME|NOTE)?\s*[:\-]?\s*(?:PLACEHOLDER|ADD YOUR|YOUR CODE HERE|implement
11
+ (?:this|later|me)|fill in|handle this|replace this|update this later|rest of the (?:code|logic)|and
12
+ so on)\b
13
+ flags: i
14
+ scan: comments
15
+ file_types:
16
+ - js
17
+ - ts
18
+ - py
19
+ - go
20
+ - java
21
+ supersedes:
22
+ - VBC-907
23
+ - VBC-150
24
+ message: >-
25
+ AI-generated placeholder comment '{match}' at line {line}. AI tools frequently emit skeleton
26
+ code with stub comments instead of real implementations. Replace with the actual logic or
27
+ open a tracked issue.
28
+ tests:
29
+ fire:
30
+ - '// TODO: implement this'
31
+ - // your code here
32
+ quiet:
33
+ - // parses the manifest and returns the entry point
@@ -0,0 +1,26 @@
1
+ id: VBC-946
2
+ name: no-verification-after-operation
3
+ severity: warning
4
+ category: correctness
5
+ tags:
6
+ - correctness
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ await\s+\w+\.(delete|remove|drop|truncate|destroy|unlink|rmdir|rm)\s*\([^)]*\)\s*;(?!\s*(?:\/\/|if|const|let|var|throw|assert|expect|check|verify|log))
11
+ multiline: true
12
+ file_types:
13
+ - js
14
+ - ts
15
+ message: >-
16
+ Destructive async operation at line {line} with no verification of success. AI agents frequently
17
+ execute irreversible actions (delete, drop, rm) based on assumed success without checking
18
+ the return value or catching errors. Always verify the outcome of destructive operations
19
+ before proceeding.
20
+ tests:
21
+ fire:
22
+ - await db.delete(id);
23
+ quiet:
24
+ - |-
25
+ await db.delete(id);
26
+ if (!(await db.find(id))) throw new Error("gone");
@@ -0,0 +1,22 @@
1
+ id: VBC-947
2
+ name: prototype-pollution-risk
3
+ severity: error
4
+ category: security
5
+ tags:
6
+ - security
7
+ - ai-error
8
+ match:
9
+ regex: >-
10
+ Object\.assign\s*\(\s*(?:req\.body|request\.body|params|query|body)\s*\)|_\.merge\s*\(\s*(?:req\.body|request\.body|params)\s*\)|Object\.assign\s*\(\s*\{\s*\}\s*,\s*(?:req\.body|request\.body)
11
+ file_types:
12
+ - js
13
+ - ts
14
+ message: >-
15
+ Merging untrusted request body directly at line {line}. This pattern enables prototype pollution:
16
+ an attacker can inject __proto__ or constructor.prototype to corrupt the application object
17
+ model. Validate and whitelist all accepted fields before merging user-supplied objects.
18
+ tests:
19
+ fire:
20
+ - Object.assign({}, req.body);
21
+ quiet:
22
+ - Object.assign({}, defaults, options);
@@ -0,0 +1,26 @@
1
+ id: VBC-948
2
+ name: em-dash-prose
3
+ severity: warning
4
+ category: docs
5
+ tags:
6
+ - docs
7
+ - ai-slop
8
+ match:
9
+ regex: —
10
+ file_types:
11
+ - md
12
+ - txt
13
+ opt_in: true
14
+ message: >-
15
+ Em dash at line {line}. They cluster heavily in generated prose, so a reader looking for
16
+ the seams finds them here first. If the break is explanatory use a colon, if it qualifies
17
+ use a comma, if it is an aside use parentheses, and if the two halves are separate thoughts
18
+ use a full stop. Keep it only where you chose it deliberately.
19
+ tests:
20
+ fire:
21
+ - The scanner failed — silently.
22
+ - Four scopes — code, strings, comments, all — cover every case.
23
+ quiet:
24
+ - The scanner failed, silently.
25
+ - Four scopes (code, strings, comments, all) cover every case.
26
+ - Copyright 2020–2026 Acme Ltd.