mirror of
https://github.com/jakejarvis/stanza.git
synced 2026-07-16 18:05:58 -04:00
- Extract a shared `CopyButton` component (`apps/web/src/components/copy-button.tsx`) — the clipboard-copy + toast + tooltip pattern was duplicated verbatim in `command-bar.tsx` and `try-it.tsx`; both now import `<CopyButton value={command} />`
- Wrap `setName` and `setSelection` in `useCallback` in `builder/index.tsx`, `onDraftChange` in `command-bar.tsx`, and `ModuleCard`'s `onClick` in `slot-cards.tsx` — these were recreated on every render, causing unnecessary child re-renders
- Move `summaries.filter(m => m.slot === slot)` into `SlotSection` and pass `summaries` + `slot` instead of a pre-filtered `modules` array; return `null` from `SlotSection` when the filtered list is empty — removes an extra allocation in the parent and colocates the null-check with the data
- Memoize `dangerouslySetInnerHTML` objects in `file-preview.tsx` and `templates-list.tsx` as `useMemo(() => ({ __html: ... }))` instead of deriving a plain string and constructing a fresh object inline on every render
- Hoist the GitHub `<a>` element in `header.tsx` to a module-level constant so the Base UI `Button render=` prop receives a stable reference across renders
- Add `oxc`, `eslint`, and `vitest` plugins to `.oxlintrc.json` for both the root config and the `apps/web/**/*.tsx` override
54 lines
1.2 KiB
JSON
54 lines
1.2 KiB
JSON
{
|
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
"plugins": ["oxc", "eslint", "typescript", "unicorn", "import", "promise", "vitest"],
|
|
"categories": {
|
|
"correctness": "error",
|
|
"suspicious": "warn",
|
|
"perf": "warn"
|
|
},
|
|
"rules": {
|
|
"no-console": "off",
|
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
"no-await-in-loop": "off",
|
|
"unicorn/no-null": "off",
|
|
"unicorn/filename-case": "off",
|
|
"unicorn/no-array-reduce": "off"
|
|
},
|
|
"ignorePatterns": [
|
|
"**/node_modules/**",
|
|
"**/dist/**",
|
|
"**/.output/**",
|
|
"**/.turbo/**",
|
|
"**/.vercel/**",
|
|
"**/*.gen.ts",
|
|
"**/coverage/**",
|
|
"registry/modules/*/templates/**"
|
|
],
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.test.ts", "**/*.test.tsx", "**/tests/**"],
|
|
"rules": {
|
|
"typescript/no-explicit-any": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": ["apps/web/**/*.tsx"],
|
|
"plugins": [
|
|
"oxc",
|
|
"eslint",
|
|
"typescript",
|
|
"react",
|
|
"react-perf",
|
|
"promise",
|
|
"jsx-a11y",
|
|
"unicorn",
|
|
"import",
|
|
"vitest"
|
|
],
|
|
"rules": {
|
|
"react/react-in-jsx-scope": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|