@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexcodeplace/slopgate",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Global code-quality / anti-slop gate — engine shared, rules per-project.",
6
6
  "license": "MIT",
@@ -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,4 +6,7 @@ note: '{"severity":"high","category":"security","resolution":"Build DOM via safe
6
6
  rule:
7
7
  any:
8
8
  - pattern: $X.innerHTML = $$$
9
- - pattern: $X.insertAdjacentHTML($$$)
9
+ - pattern: $X.insertAdjacentHTML($$$)
10
+ ignores:
11
+ - '**/*.test.ts'
12
+ - '**/*.test.tsx'
@@ -23,3 +23,6 @@ rule:
23
23
  has:
24
24
  kind: jsx_attribute
25
25
  regex: '^rel='
26
+ ignores:
27
+ - '**/*.test.ts'
28
+ - '**/*.test.tsx'
@@ -9,6 +9,8 @@ files:
9
9
  - '**/fixtures/src/components/**'
10
10
  ignores:
11
11
  - '**/features/design-system/**'
12
+ - '**/*.test.ts'
13
+ - '**/*.test.tsx'
12
14
  rule:
13
15
  any:
14
16
  - pattern: window.$PROP
@@ -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