@alexcodeplace/slopgate 0.2.0 → 0.3.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 +2 -1
- package/package.json +1 -1
- package/rules/baseline/ast/empty-catch-block-ts.yml +3 -0
- package/rules/baseline/ast/empty-catch-block-tsx.yml +3 -0
- package/rules/baseline/ast/inner-html.yml +4 -1
- package/rules/baseline/ast/target-blank-norel.yml +3 -0
- package/rules/baseline/ast/window-in-render.yml +2 -0
- package/rules/baseline/selftest.config.toml +2 -1
- package/vendor/darwin-arm64/slopgate-rs +0 -0
- package/vendor/darwin-x64/slopgate-rs +0 -0
- package/vendor/linux-arm64/slopgate-rs +0 -0
- package/vendor/linux-x64/slopgate-rs +0 -0
- package/vendor/win32-x64/slopgate-rs.exe +0 -0
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ A global code-quality / anti-slop gate for Claude Code and git. Engine is shared
|
|
|
23
23
|
- **diff-shape** — wide commits spanning too many directories (encourages focused changes)
|
|
24
24
|
|
|
25
25
|
- **Shared regex + AST rule packs** — fast-tier and commit-tier both run these
|
|
26
|
-
- Convention: `no-stubs`, `ts-suppress`, `as-any`, `raw-hex` (design tokens), `sql-safety`
|
|
26
|
+
- Convention: `no-stubs`, `ts-suppress`, `as-any`, `no-narration-comments`, `raw-hex` (design tokens), `sql-safety`
|
|
27
27
|
- Security: `live-secrets`, `eval-ban`, `pii-logs`, `weak-hash`
|
|
28
28
|
- Cloudflare boundary: `kv-ban` (plus the opt-in `stack = ["cloudflare"]` pack)
|
|
29
29
|
- Built-in AST rules: empty-catch, unsafe `innerHTML`/`dangerouslySetInnerHTML`, `target="_blank"` without `rel`, `window` access during render
|
|
@@ -388,6 +388,7 @@ All are opt-in via the `baseline` array in config. Severity drives the gate thre
|
|
|
388
388
|
| `no-stubs` | critical | convention | Stub / placeholder / "not implemented" / deferred-work markers |
|
|
389
389
|
| `ts-suppress` | high | convention | `@ts-ignore` / `@ts-expect-error` — suppressing tsc instead of fixing the cause |
|
|
390
390
|
| `as-any` | high | convention | `as any` casts that disable type safety |
|
|
391
|
+
| `no-narration-comments` | high | convention | Comments that narrate a diff/history/removal (`changed from`, `used to`, `no longer needed`, `track later`) instead of explaining a non-obvious constraint |
|
|
391
392
|
| `raw-hex` | high | convention | Hardcoded hex / `rgb()` colors + raw multi-digit `px` — use design tokens |
|
|
392
393
|
| `sql-safety` | critical | convention | `SELECT … FOR UPDATE` with an aggregate (Postgres rejects this at runtime) |
|
|
393
394
|
| `kv-ban` | critical | boundary | Cloudflare KV in read-after-write paths (eventually-consistent) |
|
package/package.json
CHANGED
|
@@ -5,3 +5,6 @@ message: Empty catch block swallows error silently
|
|
|
5
5
|
note: '{"severity":"high","category":"convention","resolution":"Handle or rethrow. Minimum: log with context (console.error). Comment-only bodies count as empty."}'
|
|
6
6
|
rule:
|
|
7
7
|
pattern: 'try { $A } catch ($E) {}'
|
|
8
|
+
ignores:
|
|
9
|
+
- '**/*.test.ts'
|
|
10
|
+
- '**/*.test.tsx'
|
|
@@ -5,3 +5,6 @@ message: Empty catch block swallows error silently
|
|
|
5
5
|
note: '{"severity":"high","category":"convention","resolution":"Handle or rethrow. Minimum: log with context (console.error). Comment-only bodies count as empty."}'
|
|
6
6
|
rule:
|
|
7
7
|
pattern: 'try { $A } catch ($E) {}'
|
|
8
|
+
ignores:
|
|
9
|
+
- '**/*.test.ts'
|
|
10
|
+
- '**/*.test.tsx'
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
roots = ["rules/baseline/fixtures/src"]
|
|
7
7
|
exts = [".ts", ".tsx"]
|
|
8
8
|
skipDirs = ["node_modules"]
|
|
9
|
-
baseline = ["no-stubs", "ts-suppress", "as-any", "raw-hex", "kv-ban", "live-secrets", "eval-ban", "pii-logs", "weak-hash", "sql-safety"]
|
|
9
|
+
baseline = ["no-stubs", "ts-suppress", "as-any", "no-narration-comments", "markers", "raw-hex", "kv-ban", "live-secrets", "eval-ban", "pii-logs", "weak-hash", "sql-safety"]
|
|
10
|
+
stack = ["debug"]
|
|
10
11
|
rules = []
|
|
11
12
|
suppressions = "./fixtures/suppressions.json"
|
|
12
13
|
fixtures = "./fixtures"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|