@fabriziosalmi/slopless 1.12.6 → 1.13.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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/engine/api.js +122 -122
  3. package/dist/index.js +167 -167
  4. package/package.json +1 -1
  5. package/rules/VBC-001.yaml +1 -0
  6. package/rules/VBC-005.yaml +1 -0
  7. package/rules/VBC-007.yaml +1 -0
  8. package/rules/VBC-008.yaml +1 -0
  9. package/rules/VBC-011.yaml +1 -0
  10. package/rules/VBC-012.yaml +1 -0
  11. package/rules/VBC-015.yaml +1 -0
  12. package/rules/VBC-016.yaml +1 -0
  13. package/rules/VBC-017.yaml +1 -0
  14. package/rules/VBC-018.yaml +1 -0
  15. package/rules/VBC-019.yaml +1 -0
  16. package/rules/VBC-023.yaml +1 -0
  17. package/rules/VBC-027.yaml +1 -0
  18. package/rules/VBC-030.yaml +1 -0
  19. package/rules/VBC-034.yaml +1 -0
  20. package/rules/VBC-039.yaml +1 -0
  21. package/rules/VBC-042.yaml +1 -0
  22. package/rules/VBC-048.yaml +1 -0
  23. package/rules/VBC-049.yaml +1 -0
  24. package/rules/VBC-051.yaml +1 -0
  25. package/rules/VBC-052.yaml +1 -0
  26. package/rules/VBC-053.yaml +1 -0
  27. package/rules/VBC-054.yaml +1 -0
  28. package/rules/VBC-056.yaml +1 -0
  29. package/rules/VBC-058.yaml +1 -0
  30. package/rules/VBC-063.yaml +1 -0
  31. package/rules/VBC-068.yaml +1 -0
  32. package/rules/VBC-070.yaml +1 -0
  33. package/rules/VBC-079.yaml +1 -0
  34. package/rules/VBC-080.yaml +1 -0
  35. package/rules/VBC-084.yaml +6 -0
  36. package/rules/VBC-090.yaml +1 -0
  37. package/rules/VBC-096.yaml +1 -0
  38. package/rules/VBC-103.yaml +1 -0
  39. package/rules/VBC-104.yaml +1 -0
  40. package/rules/VBC-112.yaml +1 -0
  41. package/rules/VBC-117.yaml +1 -0
  42. package/rules/VBC-150.yaml +1 -0
  43. package/rules/VBC-215.yaml +1 -0
  44. package/rules/VBC-338.yaml +1 -0
  45. package/rules/VBC-385.yaml +1 -0
  46. package/rules/VBC-901.yaml +17 -1
  47. package/rules/VBC-902.yaml +1 -0
  48. package/rules/VBC-903.yaml +1 -0
  49. package/rules/VBC-904.yaml +1 -0
  50. package/rules/VBC-905.yaml +1 -0
  51. package/rules/VBC-906.yaml +1 -0
  52. package/rules/VBC-907.yaml +1 -0
  53. package/rules/VBC-910.yaml +1 -0
  54. package/rules/VBC-911.yaml +1 -0
  55. package/rules/VBC-917.yaml +1 -0
  56. package/rules/VBC-938.yaml +1 -0
  57. package/rules/VBC-939.yaml +1 -0
  58. package/rules/VBC-940.yaml +1 -0
  59. package/rules/VBC-942.yaml +1 -0
  60. package/rules/VBC-943.yaml +1 -0
  61. package/rules/VBC-945.yaml +1 -0
  62. package/rules/VBC-946.yaml +1 -0
  63. package/rules/VBC-947.yaml +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriziosalmi/slopless",
3
- "version": "1.12.6",
3
+ "version": "1.13.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -24,6 +24,7 @@ match:
24
24
  file_types:
25
25
  - js
26
26
  - ts
27
+ - tsx
27
28
  - py
28
29
  - env
29
30
  - yaml
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - astro
16
17
  fix:
17
18
  regex_replace:
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - py
15
16
  - astro
16
17
  message: >-
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Using setTimeout as a sleep to paper over a race condition at line {line}. This is a flaky
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Direct document.cookie write at line {line}. Manual cookie manipulation is error-prone and
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Redundant Promise constructor wrapping at line {line}. This is an anti-pattern called "Promise
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - py
14
15
  - astro
15
16
  # The same decision as the paths below, for languages that keep their
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Potential commented-out code detected at line {line}. If the code is no longer needed, delete
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Trivially true test assertion at line {line}. This test always passes regardless of the
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: >-
14
15
  Production code with console usage '{match}' found at line {line}. Consider a professional
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - py
15
16
  - sh
16
17
  - astro
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Notification.requestPermission() detected at line {line}. Requesting browser notification
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - css
17
18
  - scss
18
19
  - astro
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Confetti or particle animation library detected at line {line}. Overusing celebration effects
@@ -15,6 +15,7 @@ match:
15
15
  file_types:
16
16
  - js
17
17
  - ts
18
+ - tsx
18
19
  - py
19
20
  - html
20
21
  - astro
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - py
13
14
  - rb
14
15
  - php
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - py
17
18
  - astro
18
19
  message: >-
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - py
14
15
  - astro
15
16
  message: >-
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - py
17
18
  - go
18
19
  - rs
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  snake_case and camelCase mixed at line {line}. Pick one convention per file. Object keys
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: >-
14
15
  Single-letter variable name detected at line {line}. Use more descriptive names.
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Redundant string interpolation detected at line {line}. Use the variable directly.
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Unnecessary 'else' after 'return' at line {line}. Remove the else and flatten the code.
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - py
17
18
  - sh
18
19
  - go
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: >-
14
15
  Overly long variable name (>35 chars) detected at line {line}. This is getting too vibey.
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - py
13
14
  - astro
14
15
  message: Empty else block detected at line {line}. This clutters the code.
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Chained or nested ternary at line {line}. Stacked conditionals are hard to read and hard
@@ -22,6 +22,7 @@ match:
22
22
  file_types:
23
23
  - js
24
24
  - ts
25
+ - tsx
25
26
  - astro
26
27
  message: >-
27
28
  Use of 'innerHTML' detected at line {line}. Use 'textContent' or a sanitizer to avoid XSS.
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: >-
14
15
  debugger; statement found at line {line}. This should never reach production.
@@ -14,6 +14,7 @@ match:
14
14
  file_types:
15
15
  - js
16
16
  - ts
17
+ - tsx
17
18
  - astro
18
19
  message: >-
19
20
  Avoid using alert() at line {line}. Use a modern UI notification system.
@@ -5,6 +5,12 @@ category: clean-code
5
5
  tags:
6
6
  - clean-code
7
7
  match:
8
+ # `.tsx` is left out on purpose, and the number is the reason. Across 525 .tsx
9
+ # and 716 .ts files from the same repositories, lines over 120 characters run
10
+ # 8.0 per .tsx file against 0.7 per .ts file. That is JSX — a className string
11
+ # and three props on one tag — not a difference in how the code was written,
12
+ # and turning it on there would file 4,274 warnings over everything else the
13
+ # rules have to say about those files.
8
14
  regex: ^.{120,}$
9
15
  scan: all
10
16
  file_types:
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - py
17
18
  - sh
18
19
  - c
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - astro
16
17
  message: >-
17
18
  Long regular expression literal at line {line} with no explanation. Add a comment stating
@@ -14,6 +14,7 @@ match:
14
14
  file_types:
15
15
  - js
16
16
  - ts
17
+ - tsx
17
18
  - py
18
19
  - sh
19
20
  - go
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - astro
16
17
  message: Mixing 'require' and 'import' in the same file at line {line}.
17
18
  tests:
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - css
13
14
  - astro
14
15
  message: >-
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - html
15
16
  - astro
16
17
  message: >-
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - py
15
16
  - sh
16
17
  - c
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Assignment to a window property at line {line}. Globals collide across scripts and outlive
@@ -16,6 +16,7 @@ match:
16
16
  - txt
17
17
  - js
18
18
  - ts
19
+ - tsx
19
20
  - py
20
21
  - astro
21
22
  message: >-
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - astro
16
17
  message: >-
17
18
  Improper success message grammar at line {line}. Use 'Data saved successfully'.
@@ -5,12 +5,20 @@ category: security
5
5
  tags:
6
6
  - security
7
7
  match:
8
+ # 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are the ranges RFC 5737
9
+ # reserves so that documentation has addresses to use. Reporting one is
10
+ # reporting an example for being an example.
11
+ #
12
+ # Nothing starting with 255 is a host: 240.0.0.0/4 is reserved, so a dotted
13
+ # quad there is a netmask or a broadcast address — `isInNet(host, "172.16.0.0",
14
+ # "255.240.0.0")` names a mask, not a machine.
8
15
  regex: >-
9
- \b(?!127\.|0\.0\.0\.0\b)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b
16
+ \b(?!127\.|0\.0\.0\.0\b|255\.|192\.0\.2\.|198\.51\.100\.|203\.0\.113\.)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b
10
17
  scan: strings
11
18
  file_types:
12
19
  - js
13
20
  - ts
21
+ - tsx
14
22
  - py
15
23
  - go
16
24
  - java
@@ -50,3 +58,11 @@ tests:
50
58
  - const version = '1.2';
51
59
  - const local = '127.0.0.1';
52
60
  - const bind = '0.0.0.0';
61
+ # RFC 5737 reserves these so documentation has addresses to use.
62
+ - const doc = '203.0.113.0';
63
+ - const example = "192.0.2.10";
64
+ - const other = '198.51.100.7';
65
+ # A mask is not a machine. (The full call `isInNet(host, "172.16.0.0",
66
+ # "255.240.0.0")` still reports — on the 172.16.0.0, which is an address.)
67
+ - const netmask = "255.240.0.0";
68
+ - const mask = '255.255.255.0';
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  document.write() is prohibited at line {line}. It is insecure and performance-heavy.
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: Passing strings to timers is eval-like and insecure at line {line}.
14
15
  tests:
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Magic string literal passed to function at line {line}. Use a named constant instead.
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: Debug console method '{line}' left in code. Remove before committing.
14
15
  tests:
@@ -13,6 +13,7 @@ match:
13
13
  file_types:
14
14
  - js
15
15
  - ts
16
+ - tsx
16
17
  - py
17
18
  - sh
18
19
  - css
@@ -14,6 +14,7 @@ match:
14
14
  file_types:
15
15
  - js
16
16
  - ts
17
+ - tsx
17
18
  - py
18
19
  - sh
19
20
  - go
@@ -9,6 +9,7 @@ match:
9
9
  file_types:
10
10
  - js
11
11
  - ts
12
+ - tsx
12
13
  - astro
13
14
  message: >-
14
15
  console.table() left in code at line {line}. Useful for debug, but clutters production logs.
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - py
14
15
  - astro
15
16
  message: >-
@@ -18,6 +18,7 @@ match:
18
18
  - rs
19
19
  - js
20
20
  - ts
21
+ - tsx
21
22
  - astro
22
23
  opt_in: true
23
24
  message: >-
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - py
15
16
  - astro
16
17
  message: >-
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  File upload handler at line {line} may lack type/size restrictions. Without validating MIME
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - py
16
17
  - astro
17
18
  supersedes:
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Route handler at line {line} may be missing authentication middleware. AI-generated route
@@ -10,6 +10,7 @@ match:
10
10
  file_types:
11
11
  - js
12
12
  - ts
13
+ - tsx
13
14
  - astro
14
15
  message: >-
15
16
  Catch clause with ignored error variable at line {line}. Using '_' as the catch binding
@@ -15,6 +15,7 @@ match:
15
15
  file_types:
16
16
  - js
17
17
  - ts
18
+ - tsx
18
19
  - py
19
20
  - go
20
21
  - java
@@ -12,6 +12,7 @@ match:
12
12
  file_types:
13
13
  - js
14
14
  - ts
15
+ - tsx
15
16
  - astro
16
17
  message: >-
17
18
  Destructive async operation at line {line} with no verification of success. AI agents frequently
@@ -11,6 +11,7 @@ match:
11
11
  file_types:
12
12
  - js
13
13
  - ts
14
+ - tsx
14
15
  - astro
15
16
  message: >-
16
17
  Merging untrusted request body directly at line {line}. This pattern enables prototype pollution: