@fabriziosalmi/slopless 1.15.3 → 1.16.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 +1 -0
- package/dist/engine/api.d.ts +1 -0
- package/dist/engine/api.js +89 -89
- package/dist/index.d.ts +1 -0
- package/dist/index.js +113 -113
- package/package.json +1 -1
- package/rules/VBC-001.yaml +5 -0
- package/rules/VBC-018.yaml +10 -0
- package/rules/VBC-504.yaml +6 -0
package/package.json
CHANGED
package/rules/VBC-001.yaml
CHANGED
|
@@ -28,6 +28,11 @@ match:
|
|
|
28
28
|
- py
|
|
29
29
|
- env
|
|
30
30
|
- yaml
|
|
31
|
+
# Both spellings. This rule was the only one that read YAML at all and it
|
|
32
|
+
# named one of them, while `.yml` is the commoner of the two — 401 against
|
|
33
|
+
# 213 across the repositories this was measured on, and it is what GitHub
|
|
34
|
+
# workflows are called.
|
|
35
|
+
- yml
|
|
31
36
|
- json
|
|
32
37
|
- astro
|
|
33
38
|
# A credential in a test is a fixture. Ten of the eleven findings this rule
|
package/rules/VBC-018.yaml
CHANGED
|
@@ -6,6 +6,11 @@ tags:
|
|
|
6
6
|
- clean-code
|
|
7
7
|
match:
|
|
8
8
|
regex: console\.(log|info|debug|dir)\(
|
|
9
|
+
# A file that opens with a shebang is run directly, and what it prints is its
|
|
10
|
+
# interface. Telling a CLI to route its own report through "a professional
|
|
11
|
+
# logging library" is advice that would break the thing it is aimed at, and it
|
|
12
|
+
# was 26 of the 35 findings this rule produced against slopless itself.
|
|
13
|
+
exclude_programs: true
|
|
9
14
|
file_types:
|
|
10
15
|
- js
|
|
11
16
|
- ts
|
|
@@ -19,3 +24,8 @@ tests:
|
|
|
19
24
|
- console.log("debug me");
|
|
20
25
|
quiet:
|
|
21
26
|
- logger.info("started");
|
|
27
|
+
# A program's output is not a leftover.
|
|
28
|
+
- file: cli.js
|
|
29
|
+
code: |
|
|
30
|
+
#!/usr/bin/env node
|
|
31
|
+
console.log("2 errors, 5 warnings");
|
package/rules/VBC-504.yaml
CHANGED
|
@@ -18,3 +18,9 @@ tests:
|
|
|
18
18
|
- const filePath = req.query.path;
|
|
19
19
|
- const fakeFs = createFakeFs();
|
|
20
20
|
- const res = await api.getNotes();
|
|
21
|
+
# Importing a module under its own name is not shadowing it. This is how
|
|
22
|
+
# every Node file in existence spells it, and it was twelve of the twelve
|
|
23
|
+
# findings this rule produced against slopless itself.
|
|
24
|
+
- const fs = require('fs');
|
|
25
|
+
- const path = require('path');
|
|
26
|
+
- const crypto = require('node:crypto');
|