Files
sim/biome.json
T
Waleed cae80c5f20 chore(lint): turn on the rules that would have caught the dead code (#7037)
Three rules were off, so nothing enforced them. Measured, fixed the sites, and
enabled them where the cost is bounded.

`noAccumulatingSpread` — 2 violations, both real O(n²) reducers, both now
`Object.fromEntries`. One duplicates a block's subBlocks on every block
duplication; the other rebuilds a Record from every workspace env var. Enabled
repo-wide.

`noUnusedVariables` / `noUnusedFunctionParameters` — 633 repo-wide, but only 6
under `packages/`. Fixed those 6 and enabled both at error for `packages/**` via
an override, which permanently covers 979 files. `apps/sim`'s remaining 627 are
left deliberately: that is a sweep of its own, and a rule enabled with 627
outstanding warnings teaches people to ignore it.

This is the class of rule whose absence let the dead code in #7019 accumulate —
eleven unread loggers, a whole unimported file, write-only locals — none of which
any gate could see.

Two of the six were in `workflow-renderer`, where the fix is narrower than it
looks. `isWorkflowRunning` is destructured-but-unread in both the block and
subflow views, and the app passes it from `workflow-block.tsx` and
`subflow-node.tsx`. Its TSDoc claimed it "holds every block's action swell open";
nothing reads it, so that behavior does not exist. Removing the prop breaks the
callers and implementing it is a UX decision — there is adjacent logic
deliberately not pinning the toolbar during a handoff. So only the unused binding
goes, and the TSDoc now says what is true.

Not enabled: `noDocumentCookie` (3 sites, and its fix is the CookieStore API,
which is a browser-support call) and `useExhaustiveDependencies` (384 errors).
2026-08-24 11:10:19 -07:00

185 lines
4.6 KiB
JSON

{
"$schema": "https://biomejs.dev/schemas/2.0.0-beta.5/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": false },
"files": {
"ignoreUnknown": false,
"includes": [
"**",
"!**/.next",
"!**/.next",
"!**/next-env.d.ts",
"!**/out",
"!**/dist",
"!**/build",
"!**/node_modules",
"!**/.bun",
"!**/.cache",
"!**/.turbo",
"!**/.DS_Store",
"!**/*.pem",
"!**/bun-debug.log*",
"!**/.env*.local",
"!**/.env",
"!**/.vercel",
"!**/coverage",
"!**/public/sw.js",
"!**/public/workbox-*.js",
"!**/public/worker-*.js",
"!**/public/fallback-*.js",
"!**/apps/sim/tools/generated",
"!**/apps/docs/.source",
"!**/apps/desktop/release",
"!**/venv",
"!**/.venv",
"!**/uploads",
"!**/apps/sim/lib/execution/sandbox/bundles/*.cjs",
"!**/test-results",
"!**/playwright-report"
]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"bracketSpacing": true
},
"assist": {
"actions": {
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [
[":NODE:", "react", "react/**"],
":PACKAGE:",
"@/components/**",
"@/lib/**",
"@/app/**",
":ALIAS:",
":RELATIVE:"
]
}
}
}
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"nursery": {
"useSortedClasses": "warn"
},
"a11y": {
"noSvgWithoutTitle": "off",
"useAltText": "off",
"useKeyWithClickEvents": "off",
"noRedundantAlt": "off",
"useSemanticElements": "off",
"useButtonType": "off",
"useFocusableInteractive": "off",
"noStaticElementInteractions": "off",
"useAriaPropsSupportedByRole": "off",
"useAriaPropsForRole": "off"
},
"suspicious": {
"noImplicitAnyLet": "off",
"noArrayIndexKey": "off",
"noExplicitAny": "off",
"noControlCharactersInRegex": "off",
"noThenProperty": "off",
"noAssignInExpressions": "off",
"noDocumentCookie": "off"
},
"correctness": {
"useExhaustiveDependencies": "off",
"noUnusedFunctionParameters": "off",
"noUnusedVariables": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
},
"style": {
"noDescendingSpecificity": "off",
"noNonNullAssertion": "off",
"noParameterAssign": "off",
"useNodejsImportProtocol": "off",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "off",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error",
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"nanoid": "Use generateId() or generateShortId() from @sim/utils/id instead",
"uuid": "Use generateId() from @sim/utils/id instead"
}
}
}
},
"complexity": {
"noForEach": "off",
"noUselessFragments": "off",
"noStaticOnlyClass": "off"
},
"performance": {
"noAccumulatingSpread": "error",
"noDelete": "error",
"noImgElement": "off"
}
}
},
"overrides": [
{
"includes": ["packages/**"],
"linter": {
"rules": {
"correctness": {
"noUnusedFunctionParameters": "error",
"noUnusedVariables": "error"
}
}
}
}
],
"javascript": {
"formatter": {
"jsxQuoteStyle": "single",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
}
},
"css": {
"parser": {
"cssModules": true
},
"formatter": {
"enabled": true,
"indentWidth": 2
}
},
"json": {
"formatter": {
"enabled": true,
"indentWidth": 2
}
}
}