Skip to content

Commit fdc1d1c

Browse files
committed
chore(sync): cascade fleet template@48ea8b4
Auto-applied by socket-wheelhouse sync-scaffolding into socket-registry. 5 file(s) touched: - .claude/hooks/no-underscore-identifier-guard/README.md - .claude/hooks/no-underscore-identifier-guard/index.mts - .claude/hooks/setup-security-tools/lib/installers.mts - .config/oxlint-plugin/rules/sort-boolean-chains.mts - docs/claude.md/fleet/tooling.md
1 parent f2ba0d0 commit fdc1d1c

3 files changed

Lines changed: 27 additions & 33 deletions

File tree

.claude/hooks/no-underscore-identifier-guard/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ underscore-prefixed **identifier** (`_resetX`, `_internal`, `_cache`, etc.).
66
## Why
77

88
Privacy in TypeScript is handled by module boundaries (not exporting) or by
9-
the `_internal/` *directory* pattern — not by leading underscores on symbol
9+
the `_internal/` _directory_ pattern — not by leading underscores on symbol
1010
names. The underscore-as-internal-marker convention is borrowed from other
1111
languages where it has runtime meaning; in TS it's purely decorative and
1212
adds noise to `git blame` and IDE autocomplete.
1313

1414
## What's banned
1515

16-
| Form | Example |
17-
| --- | --- |
18-
| Variable | `const _cache = new Map()` |
19-
| Function | `function _doResolve() {}` |
20-
| Class | `class _Helper {}` |
21-
| Interface | `interface _Options {}` |
22-
| Type alias | `type _Internal = ...` |
23-
| Re-export | `export { _foo }` |
16+
| Form | Example |
17+
| ---------- | -------------------------- |
18+
| Variable | `const _cache = new Map()` |
19+
| Function | `function _doResolve() {}` |
20+
| Class | `class _Helper {}` |
21+
| Interface | `interface _Options {}` |
22+
| Type alias | `type _Internal = ...` |
23+
| Re-export | `export { _foo }` |
2424

2525
## What's allowed
2626

.claude/hooks/no-underscore-identifier-guard/index.mts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ async function main(): Promise<void> {
175175
}
176176

177177
const text =
178-
payload.tool_input?.content ??
179-
payload.tool_input?.new_string ??
180-
''
178+
payload.tool_input?.content ?? payload.tool_input?.new_string ?? ''
181179
if (!text) {
182180
process.exit(0)
183181
}

.config/oxlint-plugin/rules/sort-boolean-chains.mts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,26 @@
22
* @file Sort all-identifier boolean chains alphanumerically. Per CLAUDE.md
33
* "Sorting" rule, a chain like `agentshieldOk && zizmorOk && sfwOk` reads
44
* with the identifier names in alpha order: `agentshieldOk && sfwOk &&
5-
* zizmorOk`. The runtime is short-circuit-insensitive to operand order
6-
* *when every operand is a plain identifier* (no calls, no member access
7-
* with getters) — so reordering doesn't change semantics. Sorting reduces
8-
* diff churn when adding a new flag and makes "is everything ready?"
9-
* checks visually consistent.
5+
* zizmorOk`. The runtime is short-circuit-insensitive to operand order _when
6+
* every operand is a plain identifier_ (no calls, no member access with
7+
* getters) — so reordering doesn't change semantics. Sorting reduces diff
8+
* churn when adding a new flag and makes "is everything ready?" checks
9+
* visually consistent. Detects: chains of `&&` or `||` whose operands are ALL
10+
* bare Identifiers (length ≥ 2, no duplicates, uniform operator across the
11+
* flattened chain). Skipped (not reported, autofix-safe stays narrow):
1012
*
11-
* Detects: chains of `&&` or `||` whose operands are ALL bare Identifiers
12-
* (length ≥ 2, no duplicates, uniform operator across the flattened chain).
13-
*
14-
* Skipped (not reported, autofix-safe stays narrow):
15-
*
16-
* - Any operand isn't a bare `Identifier` (Calls / member-access / literals
17-
* / negations / nested non-uniform logical exprs short-circuit, and a
13+
* - Any operand isn't a bare `Identifier` (Calls / member-access / literals /
14+
* negations / nested non-uniform logical exprs short-circuit, and a
1815
* `getter` on a member-access can have side effects — reordering would be
1916
* observable).
2017
* - Duplicate identifiers in the chain (rare, but rewriting through the
2118
* duplicate would silently drop one).
2219
* - Comments live between operands (autofix would relocate them).
23-
* - Chain length < 2 (nothing to sort).
24-
*
25-
* Why a separate rule from sort-equality-disjunctions: that rule sorts the
26-
* right-hand string-literal of an equality chain (`x === 'a' || x === 'b'`);
27-
* this rule sorts the bare-identifier operands of a pure-identifier chain.
28-
* Structurally different ASTs, semantically different safety arguments.
20+
* - Chain length < 2 (nothing to sort). Why a separate rule from
21+
* sort-equality-disjunctions: that rule sorts the right-hand string-literal
22+
* of an equality chain (`x === 'a' || x === 'b'`); this rule sorts the
23+
* bare-identifier operands of a pure-identifier chain. Structurally
24+
* different ASTs, semantically different safety arguments.
2925
*/
3026

3127
/**
@@ -57,9 +53,9 @@ const rule = {
5753
: context.sourceCode
5854

5955
/**
60-
* Flatten a left-associative LogicalExpression chain into leaf nodes.
61-
* `(a && b) && c` and `a && (b && c)` both flatten to [a, b, c]. Caller
62-
* checks operator uniformity.
56+
* Flatten a left-associative LogicalExpression chain into leaf nodes. `(a
57+
* && b) && c` and `a && (b && c)` both flatten to [a, b, c]. Caller checks
58+
* operator uniformity.
6359
*/
6460
function flatten(node: AstNode, op: string, out: AstNode[]): void {
6561
if (node.type === 'LogicalExpression' && node.operator === op) {

0 commit comments

Comments
 (0)