Skip to content

Commit 448080c

Browse files
committed
improvement(lint): enforce noUnusedVariables and noUnusedFunctionParameters repo-wide
Enable both rules as errors at the root with no autofix, so bun run lint never mass-renames bindings to _x, and ignoreRestSiblings so the { a, ...rest } omit idiom stays legal. The packages/** override is now redundant and removed. Document the rule in CLAUDE.md.
1 parent f37672f commit 448080c

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

‎CLAUDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ The `'use client'` server boundary, the app/worker runtime env split, and featur
8888
- **Naming**: components PascalCase (`WorkflowList`); hooks `use*`; files kebab-case (`workflow-list.tsx`); constants SCREAMING_SNAKE_CASE; interfaces PascalCase with a suffix (`WorkflowListProps`); stores `stores/<feature>/store.ts`.
8989
- **Imports**: absolute (`@/...`) only, never relative. A folder with 3+ exports gets an `index.ts` barrel; never re-export from a non-barrel file. `import type` for type-only imports. Order and lazy-loading through barrels: `.claude/rules/sim-imports.md`.
9090
- **TypeScript**: no `any` (use precise types or `unknown` with guards); a props interface for every component; `as const` for constant objects/arrays; explicit ref types (`useRef<HTMLDivElement>(null)`).
91+
- **Unused bindings** fail lint (biome `noUnusedVariables`, `noUnusedFunctionParameters`): delete the dead variable, import, or parameter and update callers; write `catch {}` when the error is unused. Prefix `_` only for a parameter that must hold its position because a later one is used. `const { a, ...rest } = obj` to omit keys is allowed. The rules carry no autofix, so `bun run lint` will not rename anything for you.
9192
- **Components**: `'use client'` only for hooks or browser APIs. Structure order, extraction thresholds, and list-render rules: `.claude/rules/sim-components.md`. Render-performance idioms (lazy-init refs, hoisting, `Map` pre-indexing, `[...arr].sort()` never `toSorted()` on client paths): `.claude/rules/sim-react-performance.md`. For effect/state/memo/callback anti-patterns use the `/you-might-not-need-*` skills and verify against the running UI.
9293
- **State ownership**: React Query owns server data — never `useState` + `fetch`; shareable client view-state (tabs, filters, search, pagination, selected id) lives in the URL via `nuqs`; Zustand owns global client state; `useState` owns UI-only state. Hooks: `.claude/rules/sim-hooks.md`. Stores (`devtools`, `persist` only with an explicit `partialize` whitelist, workflow value invariants): `.claude/rules/sim-stores.md`. URL state: `.claude/rules/sim-url-state.md`.
9394
- **Utils**: inline a helper with one consumer; create `utils.ts` when 2+ files share it — in `lib/` (app-wide) or `feature/utils/` (feature-scoped). Check `lib/` before writing a new one.

‎biome.json‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@
9999
},
100100
"correctness": {
101101
"useExhaustiveDependencies": "off",
102-
"noUnusedFunctionParameters": "off",
103-
"noUnusedVariables": "off"
102+
"noUnusedFunctionParameters": { "level": "error", "fix": "none" },
103+
"noUnusedVariables": {
104+
"level": "error",
105+
"fix": "none",
106+
"options": { "ignoreRestSiblings": true }
107+
}
104108
},
105109
"security": {
106110
"noDangerouslySetInnerHtml": "off"
@@ -146,17 +150,6 @@
146150
"includes": ["apps/sim/app/_styles/tailwind.css"],
147151
"linter": { "enabled": false },
148152
"formatter": { "enabled": false }
149-
},
150-
{
151-
"includes": ["packages/**"],
152-
"linter": {
153-
"rules": {
154-
"correctness": {
155-
"noUnusedFunctionParameters": "error",
156-
"noUnusedVariables": "error"
157-
}
158-
}
159-
}
160153
}
161154
],
162155
"javascript": {

0 commit comments

Comments
 (0)