@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.
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/dist/engine/api.d.ts +16 -0
- package/dist/engine/api.js +543 -0
- package/dist/index.d.ts +122 -0
- package/dist/index.js +590 -0
- package/package.json +59 -0
- package/rules/VBC-001.yaml +33 -0
- package/rules/VBC-002.yaml +13 -0
- package/rules/VBC-003.yaml +36 -0
- package/rules/VBC-004.yaml +33 -0
- package/rules/VBC-005.yaml +24 -0
- package/rules/VBC-006.yaml +16 -0
- package/rules/VBC-007.yaml +28 -0
- package/rules/VBC-008.yaml +21 -0
- package/rules/VBC-009.yaml +24 -0
- package/rules/VBC-010.yaml +24 -0
- package/rules/VBC-011.yaml +21 -0
- package/rules/VBC-012.yaml +21 -0
- package/rules/VBC-013.yaml +17 -0
- package/rules/VBC-014.yaml +15 -0
- package/rules/VBC-015.yaml +40 -0
- package/rules/VBC-016.yaml +21 -0
- package/rules/VBC-017.yaml +23 -0
- package/rules/VBC-018.yaml +19 -0
- package/rules/VBC-019.yaml +42 -0
- package/rules/VBC-020.yaml +22 -0
- package/rules/VBC-021.yaml +22 -0
- package/rules/VBC-022.yaml +21 -0
- package/rules/VBC-023.yaml +22 -0
- package/rules/VBC-024.yaml +26 -0
- package/rules/VBC-025.yaml +13 -0
- package/rules/VBC-026.yaml +17 -0
- package/rules/VBC-027.yaml +27 -0
- package/rules/VBC-028.yaml +18 -0
- package/rules/VBC-029.yaml +22 -0
- package/rules/VBC-030.yaml +22 -0
- package/rules/VBC-032.yaml +20 -0
- package/rules/VBC-033.yaml +26 -0
- package/rules/VBC-034.yaml +41 -0
- package/rules/VBC-035.yaml +30 -0
- package/rules/VBC-039.yaml +18 -0
- package/rules/VBC-042.yaml +26 -0
- package/rules/VBC-045.yaml +13 -0
- package/rules/VBC-046.yaml +13 -0
- package/rules/VBC-048.yaml +23 -0
- package/rules/VBC-049.yaml +19 -0
- package/rules/VBC-051.yaml +23 -0
- package/rules/VBC-052.yaml +19 -0
- package/rules/VBC-053.yaml +19 -0
- package/rules/VBC-054.yaml +29 -0
- package/rules/VBC-056.yaml +28 -0
- package/rules/VBC-057.yaml +18 -0
- package/rules/VBC-058.yaml +18 -0
- package/rules/VBC-059.yaml +21 -0
- package/rules/VBC-063-B.yaml +15 -0
- package/rules/VBC-063.yaml +18 -0
- package/rules/VBC-065.yaml +33 -0
- package/rules/VBC-066.yaml +16 -0
- package/rules/VBC-068.yaml +21 -0
- package/rules/VBC-070.yaml +19 -0
- package/rules/VBC-077.yaml +35 -0
- package/rules/VBC-079.yaml +18 -0
- package/rules/VBC-080.yaml +18 -0
- package/rules/VBC-084.yaml +22 -0
- package/rules/VBC-086.yaml +22 -0
- package/rules/VBC-090.yaml +28 -0
- package/rules/VBC-096.yaml +19 -0
- package/rules/VBC-097.yaml +21 -0
- package/rules/VBC-098.yaml +18 -0
- package/rules/VBC-101.yaml +23 -0
- package/rules/VBC-102.yaml +20 -0
- package/rules/VBC-103.yaml +35 -0
- package/rules/VBC-104.yaml +24 -0
- package/rules/VBC-106.yaml +14 -0
- package/rules/VBC-112.yaml +20 -0
- package/rules/VBC-113.yaml +19 -0
- package/rules/VBC-117.yaml +21 -0
- package/rules/VBC-123.yaml +29 -0
- package/rules/VBC-131.yaml +20 -0
- package/rules/VBC-150.yaml +27 -0
- package/rules/VBC-153.yaml +21 -0
- package/rules/VBC-158.yaml +16 -0
- package/rules/VBC-161.yaml +27 -0
- package/rules/VBC-172.yaml +25 -0
- package/rules/VBC-197.yaml +22 -0
- package/rules/VBC-201.yaml +35 -0
- package/rules/VBC-206.yaml +19 -0
- package/rules/VBC-208.yaml +27 -0
- package/rules/VBC-212.yaml +19 -0
- package/rules/VBC-215.yaml +24 -0
- package/rules/VBC-305.yaml +20 -0
- package/rules/VBC-324.yaml +24 -0
- package/rules/VBC-334.yaml +23 -0
- package/rules/VBC-338.yaml +32 -0
- package/rules/VBC-340.yaml +22 -0
- package/rules/VBC-344.yaml +19 -0
- package/rules/VBC-347.yaml +21 -0
- package/rules/VBC-348.yaml +19 -0
- package/rules/VBC-385.yaml +21 -0
- package/rules/VBC-398.yaml +22 -0
- package/rules/VBC-401.yaml +12 -0
- package/rules/VBC-414.yaml +23 -0
- package/rules/VBC-421.yaml +20 -0
- package/rules/VBC-501.yaml +18 -0
- package/rules/VBC-502.yaml +23 -0
- package/rules/VBC-503.yaml +18 -0
- package/rules/VBC-504.yaml +20 -0
- package/rules/VBC-800.yaml +17 -0
- package/rules/VBC-901.yaml +48 -0
- package/rules/VBC-902.yaml +19 -0
- package/rules/VBC-903.yaml +17 -0
- package/rules/VBC-904.yaml +21 -0
- package/rules/VBC-905.yaml +17 -0
- package/rules/VBC-906.yaml +29 -0
- package/rules/VBC-907.yaml +24 -0
- package/rules/VBC-908.yaml +22 -0
- package/rules/VBC-909.yaml +21 -0
- package/rules/VBC-910.yaml +18 -0
- package/rules/VBC-911.yaml +21 -0
- package/rules/VBC-913.yaml +30 -0
- package/rules/VBC-914.yaml +31 -0
- package/rules/VBC-915.yaml +19 -0
- package/rules/VBC-916.yaml +24 -0
- package/rules/VBC-917.yaml +21 -0
- package/rules/VBC-918.yaml +22 -0
- package/rules/VBC-920.yaml +20 -0
- package/rules/VBC-921.yaml +45 -0
- package/rules/VBC-922.yaml +15 -0
- package/rules/VBC-923.yaml +15 -0
- package/rules/VBC-924.yaml +12 -0
- package/rules/VBC-925.yaml +14 -0
- package/rules/VBC-926.yaml +14 -0
- package/rules/VBC-927.yaml +24 -0
- package/rules/VBC-928.yaml +25 -0
- package/rules/VBC-929.yaml +21 -0
- package/rules/VBC-930.yaml +16 -0
- package/rules/VBC-931.yaml +16 -0
- package/rules/VBC-932.yaml +16 -0
- package/rules/VBC-933.yaml +28 -0
- package/rules/VBC-934.yaml +24 -0
- package/rules/VBC-935.yaml +26 -0
- package/rules/VBC-936.yaml +24 -0
- package/rules/VBC-937.yaml +24 -0
- package/rules/VBC-938.yaml +23 -0
- package/rules/VBC-939.yaml +23 -0
- package/rules/VBC-940.yaml +30 -0
- package/rules/VBC-941.yaml +28 -0
- package/rules/VBC-942.yaml +23 -0
- package/rules/VBC-943.yaml +22 -0
- package/rules/VBC-944.yaml +26 -0
- package/rules/VBC-945.yaml +33 -0
- package/rules/VBC-946.yaml +26 -0
- package/rules/VBC-947.yaml +22 -0
- package/rules/VBC-948.yaml +26 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: VBC-212
|
|
2
|
+
name: keyboard-focus-awareness
|
|
3
|
+
severity: warning
|
|
4
|
+
category: ux-dx
|
|
5
|
+
tags:
|
|
6
|
+
- accessibility
|
|
7
|
+
match:
|
|
8
|
+
regex: :focus\s*\{.*?outline:\s*none
|
|
9
|
+
file_types:
|
|
10
|
+
- css
|
|
11
|
+
- scss
|
|
12
|
+
message: >-
|
|
13
|
+
Suppressing focus outline without providing an alternative at line {line}. This makes keyboard
|
|
14
|
+
navigation impossible.
|
|
15
|
+
tests:
|
|
16
|
+
fire:
|
|
17
|
+
- 'a:focus { outline: none; }'
|
|
18
|
+
quiet:
|
|
19
|
+
- 'a:focus { outline: 2px solid; }'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
id: VBC-215
|
|
2
|
+
name: global-pollutant
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- security
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
window\.(?!location\b|on[a-z]+\b|name\b|opener\b|status\b|document\b|history\b|scrollX\b|scrollY\b|top\b|self\b|parent\b)[a-zA-Z0-9_$]+\s*=(?!=)
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
message: >-
|
|
15
|
+
Assignment to a window property at line {line}. Globals collide across scripts and outlive
|
|
16
|
+
the code that set them. Export the value, or attach it under one namespaced object if a
|
|
17
|
+
global is genuinely needed.
|
|
18
|
+
tests:
|
|
19
|
+
fire:
|
|
20
|
+
- window.myApp = createApp();
|
|
21
|
+
quiet:
|
|
22
|
+
- window.location = target;
|
|
23
|
+
- window.onload = init;
|
|
24
|
+
- if (window.myApp === undefined) { boot(); }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: VBC-305
|
|
2
|
+
name: hardcoded-font-size
|
|
3
|
+
severity: warning
|
|
4
|
+
category: ux-dx
|
|
5
|
+
tags:
|
|
6
|
+
- ux
|
|
7
|
+
- accessibility
|
|
8
|
+
match:
|
|
9
|
+
regex: font-size:\s*[0-9]+(px|pt|pc)
|
|
10
|
+
file_types:
|
|
11
|
+
- css
|
|
12
|
+
- scss
|
|
13
|
+
message: >-
|
|
14
|
+
Hardcoded font size '{match}' detected at line {line}. Use relative units (rem/em) for better
|
|
15
|
+
accessibility and user scale preferences.
|
|
16
|
+
tests:
|
|
17
|
+
fire:
|
|
18
|
+
- 'body { font-size: 14px; }'
|
|
19
|
+
quiet:
|
|
20
|
+
- 'body { font-size: 1rem; }'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
id: VBC-324
|
|
2
|
+
name: condescending-language
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
\b(?:simply|basically|obviously|clearly|everyone knows|as anyone can see)\b|\bjust\s+(?:run|do|add|use|call|type|install|click|open|set)\b|\beasily\b
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
- txt
|
|
14
|
+
opt_in: true
|
|
15
|
+
message: >-
|
|
16
|
+
Condescending or vague language '{match}' detected at line {line}. Be direct and avoid assumptions
|
|
17
|
+
about the reader's knowledge.
|
|
18
|
+
tests:
|
|
19
|
+
fire:
|
|
20
|
+
- Simply run the installer.
|
|
21
|
+
- Just run npm install.
|
|
22
|
+
quiet:
|
|
23
|
+
- Run the installer.
|
|
24
|
+
- We just released version 2.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: VBC-334
|
|
2
|
+
name: ai-generated-fluff
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- content
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
(As an AI language model|It's important to remember that|In conclusion,|Let's dive into|the
|
|
11
|
+
landscape of|tapestry of|delve into|unleash|unlocking|delving into|testament to)
|
|
12
|
+
flags: i
|
|
13
|
+
file_types:
|
|
14
|
+
- md
|
|
15
|
+
- txt
|
|
16
|
+
message: >-
|
|
17
|
+
Potential AI-generated fluff or overused cliché '{match}' detected at line {line}. Keep
|
|
18
|
+
documentation concise and human-centric.
|
|
19
|
+
tests:
|
|
20
|
+
fire:
|
|
21
|
+
- Let's dive into the tapestry of configuration.
|
|
22
|
+
quiet:
|
|
23
|
+
- This section covers configuration.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
id: VBC-338
|
|
2
|
+
name: non-inclusive-terminology
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- inclusive-language
|
|
8
|
+
match:
|
|
9
|
+
regex: >-
|
|
10
|
+
\bmaster[\s/-]?slave\b|\bslaves?\b|\bmaster\s+(?:branch|node|server|database|db|key|process|replica|copy)\b|\b(?:origin/)?master\b(?=\s*(?:branch\b|$))|\bblacklist(?:ed|ing)?\b|\bwhitelist(?:ed|ing)?\b|\bsanity[-
|
|
11
|
+
]check\b
|
|
12
|
+
flags: i
|
|
13
|
+
scan: all
|
|
14
|
+
file_types:
|
|
15
|
+
- md
|
|
16
|
+
- txt
|
|
17
|
+
- js
|
|
18
|
+
- ts
|
|
19
|
+
- py
|
|
20
|
+
message: >-
|
|
21
|
+
Non-inclusive terminology at line {line}. Prefer main, primary/replica, allowlist/blocklist,
|
|
22
|
+
and a plain "check". Domain uses such as an audio master bus or a mastering chain are not
|
|
23
|
+
reported.
|
|
24
|
+
tests:
|
|
25
|
+
fire:
|
|
26
|
+
- Push to the master branch.
|
|
27
|
+
- Add the host to the whitelist.
|
|
28
|
+
quiet:
|
|
29
|
+
- Push to the main branch.
|
|
30
|
+
- Add the host to the allowlist.
|
|
31
|
+
- Master section accent colour.
|
|
32
|
+
- The audio mastering chain.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: VBC-340
|
|
2
|
+
name: gendered-address
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- inclusive-language
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
\b(?:hey|you)\s+guys\b|\bguys\b|\bhe\s*/\s*she\b|\bhis\s*/\s*her\b|\bs\s*/\s*he\b
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
- txt
|
|
14
|
+
message: >-
|
|
15
|
+
Gendered language detected at line {line}. Use 'folks', 'everyone', or 'they'.
|
|
16
|
+
tests:
|
|
17
|
+
fire:
|
|
18
|
+
- Hey guys, run the migration first.
|
|
19
|
+
- The reviewer must confirm he/she read it.
|
|
20
|
+
quiet:
|
|
21
|
+
- Run the migration first.
|
|
22
|
+
- She reviewed the pull request.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: VBC-344
|
|
2
|
+
name: non-iso-date
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
\b(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/(19|20)\d\d\b|\d{1,2}-\d{1,2}-\d{4}
|
|
10
|
+
file_types:
|
|
11
|
+
- md
|
|
12
|
+
- txt
|
|
13
|
+
message: >-
|
|
14
|
+
Non-ISO 8601 date found at line {line}. Use YYYY-MM-DD to avoid regional confusion.
|
|
15
|
+
tests:
|
|
16
|
+
fire:
|
|
17
|
+
- Released on 03/14/2026.
|
|
18
|
+
quiet:
|
|
19
|
+
- Released on 2026-03-14.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: VBC-347
|
|
2
|
+
name: passive-voice
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- style
|
|
8
|
+
match:
|
|
9
|
+
regex: \b(?:is|are|was|were|be|been|being)\s+(?:\w+\s+)?\w+ed\s+by\b
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
opt_in: true
|
|
14
|
+
message: >-
|
|
15
|
+
Potential passive voice at line {line}. Consider using active voice for clarity.
|
|
16
|
+
tests:
|
|
17
|
+
fire:
|
|
18
|
+
- The schema is validated by the loader.
|
|
19
|
+
quiet:
|
|
20
|
+
- The loader validates the schema.
|
|
21
|
+
- The cache is advanced automatically.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: VBC-348
|
|
2
|
+
name: click-here-links
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- accessibility
|
|
7
|
+
- docs
|
|
8
|
+
match:
|
|
9
|
+
regex: \[(click here|read more|here)\]\(.*?\)
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
message: >-
|
|
14
|
+
Vague link text found at line {line}. Describe the destination for better accessibility.
|
|
15
|
+
tests:
|
|
16
|
+
fire:
|
|
17
|
+
- See [click here](./guide.md).
|
|
18
|
+
quiet:
|
|
19
|
+
- See [the deployment guide](./guide.md).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: VBC-385
|
|
2
|
+
name: success-message-grammar
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- ux
|
|
7
|
+
- copy
|
|
8
|
+
match:
|
|
9
|
+
regex: '[''"]Data save success[''"]|[''"]Save success[''"]'
|
|
10
|
+
flags: i
|
|
11
|
+
scan: strings
|
|
12
|
+
file_types:
|
|
13
|
+
- js
|
|
14
|
+
- ts
|
|
15
|
+
message: >-
|
|
16
|
+
Improper success message grammar at line {line}. Use 'Data saved successfully'.
|
|
17
|
+
tests:
|
|
18
|
+
fire:
|
|
19
|
+
- toast('Data save success');
|
|
20
|
+
quiet:
|
|
21
|
+
- toast('Data saved successfully');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: VBC-398
|
|
2
|
+
name: panic-punctuation
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- ux
|
|
7
|
+
- copy
|
|
8
|
+
match:
|
|
9
|
+
regex: \w[!?]{2,}(?=[\s)\]\"'`]|$)
|
|
10
|
+
file_types:
|
|
11
|
+
- md
|
|
12
|
+
- txt
|
|
13
|
+
opt_in: true
|
|
14
|
+
message: >-
|
|
15
|
+
Excessive punctuation at line {line}. Professional copy should avoid multiple symbols like
|
|
16
|
+
'!!!'.
|
|
17
|
+
tests:
|
|
18
|
+
fire:
|
|
19
|
+
- This matters!!!
|
|
20
|
+
quiet:
|
|
21
|
+
- This matters.
|
|
22
|
+
- const value = a ?? b;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
id: VBC-401
|
|
2
|
+
name: broken-links
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- maintenance
|
|
8
|
+
match:
|
|
9
|
+
heuristic_check: link-checker
|
|
10
|
+
message: Broken link '{match}' ({url}) detected at line {line}.
|
|
11
|
+
tests:
|
|
12
|
+
external: 'heuristic-checker.test.ts: resolves links against the filesystem'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: VBC-414
|
|
2
|
+
name: please-in-cli
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- ux
|
|
7
|
+
- cli
|
|
8
|
+
match:
|
|
9
|
+
regex: Please run|Please make sure
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
- sh
|
|
14
|
+
message: >-
|
|
15
|
+
Avoid using 'Please' in technical instructions at line {line}. Use direct imperative mood
|
|
16
|
+
(e.g., 'Run...' instead of 'Please run...').
|
|
17
|
+
tests:
|
|
18
|
+
fire:
|
|
19
|
+
- file: fixture.md
|
|
20
|
+
code: Please run the migration first.
|
|
21
|
+
quiet:
|
|
22
|
+
- file: fixture.md
|
|
23
|
+
code: Run the migration first.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: VBC-421
|
|
2
|
+
name: filler-words
|
|
3
|
+
severity: warning
|
|
4
|
+
category: docs
|
|
5
|
+
tags:
|
|
6
|
+
- docs
|
|
7
|
+
- style
|
|
8
|
+
match:
|
|
9
|
+
regex: \b(essentially|actually|literally)\b
|
|
10
|
+
flags: i
|
|
11
|
+
file_types:
|
|
12
|
+
- md
|
|
13
|
+
opt_in: true
|
|
14
|
+
message: >-
|
|
15
|
+
Filler word detected at line {line}. Be more direct in your documentation.
|
|
16
|
+
tests:
|
|
17
|
+
fire:
|
|
18
|
+
- This is essentially a cache.
|
|
19
|
+
quiet:
|
|
20
|
+
- This is a cache.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
id: VBC-501
|
|
2
|
+
name: boolean-naming-vibes
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- semantic
|
|
8
|
+
match:
|
|
9
|
+
semantic_check: boolean-naming
|
|
10
|
+
message: >-
|
|
11
|
+
Boolean variable '{name}' has no standard prefix. Consider is{name}, has{name}, or can{name}
|
|
12
|
+
for clarity.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- const ready = true;
|
|
16
|
+
quiet:
|
|
17
|
+
- const isReady = true;
|
|
18
|
+
- const count = 3;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: VBC-502
|
|
2
|
+
name: redundant-boolean-logic
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- semantic
|
|
8
|
+
match:
|
|
9
|
+
semantic_check: boolean-redundancy
|
|
10
|
+
message: >-
|
|
11
|
+
Redundant boolean return detected. This if/else block can be replaced by a single 'return'
|
|
12
|
+
with a boolean expression.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- |
|
|
16
|
+
function check(a) {
|
|
17
|
+
if (a) { return true; } else { return false; }
|
|
18
|
+
}
|
|
19
|
+
quiet:
|
|
20
|
+
- |
|
|
21
|
+
function check(a) {
|
|
22
|
+
return Boolean(a);
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
id: VBC-503
|
|
2
|
+
name: collection-naming-vibes
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- semantic
|
|
8
|
+
match:
|
|
9
|
+
semantic_check: collection-suffix
|
|
10
|
+
message: >-
|
|
11
|
+
Array named '{name}' is missing a plural 's' or a collection suffix (List, Array). This
|
|
12
|
+
makes code less intuitive.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- const user = [1, 2, 3];
|
|
16
|
+
quiet:
|
|
17
|
+
- const users = [1, 2, 3];
|
|
18
|
+
- const userList = [1];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: VBC-504
|
|
2
|
+
name: semantic-shadowing
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- semantic
|
|
8
|
+
match:
|
|
9
|
+
semantic_check: semantic-shadowing
|
|
10
|
+
message: >-
|
|
11
|
+
Variable '{name}' shadows a common library or system keyword. This can cause confusion during
|
|
12
|
+
debugging.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- const path = req.query.path;
|
|
16
|
+
- const fs = createFakeFs();
|
|
17
|
+
quiet:
|
|
18
|
+
- const filePath = req.query.path;
|
|
19
|
+
- const fakeFs = createFakeFs();
|
|
20
|
+
- const res = await api.getNotes();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
id: VBC-800
|
|
2
|
+
name: floating-promise
|
|
3
|
+
severity: error
|
|
4
|
+
category: core
|
|
5
|
+
tags:
|
|
6
|
+
- correctness
|
|
7
|
+
- async
|
|
8
|
+
match:
|
|
9
|
+
file_types:
|
|
10
|
+
- ts
|
|
11
|
+
- tsx
|
|
12
|
+
type_check: floating-promise
|
|
13
|
+
message: >-
|
|
14
|
+
Unawaited Promise detected. Expected await or return, but got {match}. Floating promises
|
|
15
|
+
can cause unhandled rejections and race conditions.
|
|
16
|
+
tests:
|
|
17
|
+
external: 'type-checker.test.ts: needs a ts.Program and TypeChecker'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
id: VBC-901
|
|
2
|
+
name: hardcoded-ip-v4
|
|
3
|
+
severity: warning
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
match:
|
|
8
|
+
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
|
|
10
|
+
scan: strings
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
- py
|
|
15
|
+
- go
|
|
16
|
+
- java
|
|
17
|
+
- json
|
|
18
|
+
- env
|
|
19
|
+
exclude_files:
|
|
20
|
+
- '**/test/**'
|
|
21
|
+
- '**/tests/**'
|
|
22
|
+
- '**/__tests__/**'
|
|
23
|
+
- '**/testdata/**'
|
|
24
|
+
- '**/fixtures/**'
|
|
25
|
+
- '**/test_*.py'
|
|
26
|
+
- '**/*_test.py'
|
|
27
|
+
- '**/test.py'
|
|
28
|
+
- '**/conftest.py'
|
|
29
|
+
- '**/*_test.go'
|
|
30
|
+
- '**/*_bench.go'
|
|
31
|
+
- '**/*.test.*'
|
|
32
|
+
- '**/*.spec.*'
|
|
33
|
+
- '**/bench/**'
|
|
34
|
+
- '**/benchmark*'
|
|
35
|
+
- '**/*corpus*'
|
|
36
|
+
- '**/*payload*'
|
|
37
|
+
message: >-
|
|
38
|
+
Hardcoded IP address at line {line}. It pins the code to one environment. Read it from configuration.
|
|
39
|
+
Loopback and 0.0.0.0 are not reported: they name this machine rather than a particular host.
|
|
40
|
+
tests:
|
|
41
|
+
fire:
|
|
42
|
+
- const host = '192.168.1.50';
|
|
43
|
+
- const dns = "8.8.8.8";
|
|
44
|
+
quiet:
|
|
45
|
+
- const host = process.env.DB_HOST;
|
|
46
|
+
- const version = '1.2';
|
|
47
|
+
- const local = '127.0.0.1';
|
|
48
|
+
- const bind = '0.0.0.0';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
id: VBC-902
|
|
2
|
+
name: document-write-slop
|
|
3
|
+
severity: error
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
- performance
|
|
8
|
+
match:
|
|
9
|
+
regex: document\.write\(
|
|
10
|
+
file_types:
|
|
11
|
+
- js
|
|
12
|
+
- ts
|
|
13
|
+
message: >-
|
|
14
|
+
document.write() is prohibited at line {line}. It is insecure and performance-heavy.
|
|
15
|
+
tests:
|
|
16
|
+
fire:
|
|
17
|
+
- document.write("<p>hi</p>");
|
|
18
|
+
quiet:
|
|
19
|
+
- container.append(paragraph);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
id: VBC-903
|
|
2
|
+
name: eval-like-timers
|
|
3
|
+
severity: error
|
|
4
|
+
category: security
|
|
5
|
+
tags:
|
|
6
|
+
- security
|
|
7
|
+
match:
|
|
8
|
+
regex: (setTimeout|setInterval)\s*\(\s*['"].*?['"]
|
|
9
|
+
file_types:
|
|
10
|
+
- js
|
|
11
|
+
- ts
|
|
12
|
+
message: Passing strings to timers is eval-like and insecure at line {line}.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- setTimeout("poll()", 100);
|
|
16
|
+
quiet:
|
|
17
|
+
- setTimeout(poll, 100);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: VBC-904
|
|
2
|
+
name: magic-string
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
(?<![.\w$])(?!(?:Error|TypeError|RangeError|SyntaxError|EvalError|URIError|log|info|warn|error|debug|trace|assert|describe|it|test|expect|require|import|t|_|gettext|translate|print)\s*\()[a-zA-Z_$][\w$]*\(\s*['\"][a-zA-Z0-9_\s]{10,}['\"]\s*\)
|
|
10
|
+
file_types:
|
|
11
|
+
- js
|
|
12
|
+
- ts
|
|
13
|
+
message: >-
|
|
14
|
+
Magic string literal passed to function at line {line}. Use a named constant instead.
|
|
15
|
+
tests:
|
|
16
|
+
fire:
|
|
17
|
+
- configure("some long option value");
|
|
18
|
+
quiet:
|
|
19
|
+
- throw new Error('failed to reach the database');
|
|
20
|
+
- console.log('worker pool started');
|
|
21
|
+
- describe('the retry scheduler', run);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
id: VBC-905
|
|
2
|
+
name: debug-console-usage
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
match:
|
|
8
|
+
regex: console\.(count|time|timeEnd|trace|profile)\(
|
|
9
|
+
file_types:
|
|
10
|
+
- js
|
|
11
|
+
- ts
|
|
12
|
+
message: Debug console method '{line}' left in code. Remove before committing.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- console.time("boot");
|
|
16
|
+
quiet:
|
|
17
|
+
- metrics.start("boot");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
id: VBC-906
|
|
2
|
+
name: fixme-technical-debt
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
\bFIXME\b[^\n]{0,90}?\b(?:broken|crash\w*|leak\w*|race|deadlock|security|vulnerab\w+|data
|
|
10
|
+
?loss|corrupt\w*|unsafe)\b
|
|
11
|
+
flags: i
|
|
12
|
+
scan: comments
|
|
13
|
+
file_types:
|
|
14
|
+
- js
|
|
15
|
+
- ts
|
|
16
|
+
- py
|
|
17
|
+
- sh
|
|
18
|
+
- css
|
|
19
|
+
supersedes:
|
|
20
|
+
- VBC-907
|
|
21
|
+
- VBC-150
|
|
22
|
+
message: >-
|
|
23
|
+
FIXME describing a live defect at line {line}. This is not style debt, it is a known bug
|
|
24
|
+
in shipped code. Open an issue and fix it.
|
|
25
|
+
tests:
|
|
26
|
+
fire:
|
|
27
|
+
- // FIXME the parser crashes on empty input
|
|
28
|
+
quiet:
|
|
29
|
+
- '// FIXME(fab): tidy the parser'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
id: VBC-907
|
|
2
|
+
name: anonymous-todo
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
match:
|
|
8
|
+
regex: >-
|
|
9
|
+
\b(?:TODO|FIXME|HACK|XXX)\b(?!\s*[\(\[][^)\]\n]+[\)\]])(?!\s*:?\s*(?:#\d+|[A-Z][A-Z0-9]+-\d+))
|
|
10
|
+
scan: comments
|
|
11
|
+
file_types:
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
- py
|
|
15
|
+
- sh
|
|
16
|
+
message: >-
|
|
17
|
+
Unattributed debt marker at line {line}. Nobody owns it, so nobody will fix it. Use TODO(owner):
|
|
18
|
+
or reference an issue such as TODO: #123.
|
|
19
|
+
tests:
|
|
20
|
+
fire:
|
|
21
|
+
- '// TODO: wire up retries'
|
|
22
|
+
quiet:
|
|
23
|
+
- '// TODO(fab): wire up retries'
|
|
24
|
+
- '// TODO: #123 wire up retries'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
id: VBC-908
|
|
2
|
+
name: long-inline-style
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- css
|
|
8
|
+
match:
|
|
9
|
+
regex: style\s*=\s*['"].{50,}['"]
|
|
10
|
+
file_types:
|
|
11
|
+
- html
|
|
12
|
+
- js
|
|
13
|
+
- ts
|
|
14
|
+
- tsx
|
|
15
|
+
message: >-
|
|
16
|
+
Overly long inline style attribute at line {line}. Move styles to a CSS file or component.
|
|
17
|
+
tests:
|
|
18
|
+
fire:
|
|
19
|
+
- >-
|
|
20
|
+
<div style="display:flex;align-items:center;justify-content:space-between;padding:8px">x</div>
|
|
21
|
+
quiet:
|
|
22
|
+
- <div className="row">x</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: VBC-909
|
|
2
|
+
name: empty-interface-ts
|
|
3
|
+
severity: warning
|
|
4
|
+
category: clean-code
|
|
5
|
+
tags:
|
|
6
|
+
- clean-code
|
|
7
|
+
- typescript
|
|
8
|
+
match:
|
|
9
|
+
ast_check:
|
|
10
|
+
type: empty-interface
|
|
11
|
+
message: >-
|
|
12
|
+
Empty interface detected. If intentional, add a comment; otherwise, remove it.
|
|
13
|
+
tests:
|
|
14
|
+
fire:
|
|
15
|
+
- file: fixture.ts
|
|
16
|
+
code: interface Options {}
|
|
17
|
+
quiet:
|
|
18
|
+
- file: fixture.ts
|
|
19
|
+
code: interface Options extends BaseOptions {}
|
|
20
|
+
- file: fixture.ts
|
|
21
|
+
code: 'interface Options { retries: number; }'
|