diff --git a/eslint.config.js b/eslint.config.js index 609bcfc..4df57b7 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -9,7 +9,7 @@ import tseslint from "typescript-eslint"; import { defineConfig, globalIgnores } from "eslint/config"; export default defineConfig([ - globalIgnores(["dist", "storybook-static"]), + globalIgnores(["dist", "storybook-static", "gitignore"]), { files: ["**/*.{ts,tsx}"], extends: [ @@ -24,7 +24,10 @@ export default defineConfig([ }, rules: { "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-unused-vars": ["warn", { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + }], }, }, ...storybook.configs["flat/recommended"], diff --git a/scripts/generate-css.ts b/scripts/generate-css.ts index f0f98bb..19c0409 100644 --- a/scripts/generate-css.ts +++ b/scripts/generate-css.ts @@ -25,7 +25,6 @@ const root = path.resolve(import.meta.dirname, '..'); interface DimensionValue { value: number; unit: string } interface DTCGToken { $value: unknown; $type: string; $description?: string } -interface TokenGroup { [key: string]: DTCGToken | TokenGroup } interface TokenFile { color: Record>; diff --git a/scripts/token-server.ts b/scripts/token-server.ts index 6d0f3b2..7b249cf 100644 --- a/scripts/token-server.ts +++ b/scripts/token-server.ts @@ -86,7 +86,7 @@ const server = http.createServer((req, res) => { try { const content = fs.readFileSync(filePath, 'utf-8'); json(res, 200, JSON.parse(content)); - } catch (err) { + } catch { json(res, 500, { error: `Failed to read ${tokenType} tokens` }); } return; diff --git a/src/components/Dropdown/DropdownField.test.tsx b/src/components/Dropdown/DropdownField.test.tsx index 1aa3e5d..0e453fe 100644 --- a/src/components/Dropdown/DropdownField.test.tsx +++ b/src/components/Dropdown/DropdownField.test.tsx @@ -9,11 +9,6 @@ const choices = { choiceValues: ["red", "green", "blue"], }; -// Helper to open the dropdown -async function openDropdown(user: ReturnType) { - await user.click(screen.getByRole("button", { name: /select\.\.\.|red|green|blue/i })); -} - // ─── DropdownField (single-select) ─────────────────────────────────────────── describe("DropdownField - visibility", () => { diff --git a/src/components/MessageBanner/MessageBanner.tsx b/src/components/MessageBanner/MessageBanner.tsx index 1a43ee6..f469cc1 100644 --- a/src/components/MessageBanner/MessageBanner.tsx +++ b/src/components/MessageBanner/MessageBanner.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { Info, CheckCircle, AlertCircle, AlertTriangle, X } from 'lucide-react' +import { Info, CheckCircle, AlertCircle, AlertTriangle } from 'lucide-react' import type { SAILShape, SAILMarginSize, SAILAlign } from '../../types/sail' import type { ButtonWidgetProps } from '../Button/ButtonWidget' import { ButtonWidget } from '../Button/ButtonWidget' diff --git a/src/components/RadioButton/RadioButtonField.test.tsx b/src/components/RadioButton/RadioButtonField.test.tsx index 89a985e..a76184b 100644 --- a/src/components/RadioButton/RadioButtonField.test.tsx +++ b/src/components/RadioButton/RadioButtonField.test.tsx @@ -174,7 +174,7 @@ describe("RadioButtonField - choiceStyle CARDS", () => { it("clicking the card container (not the input) triggers selection", async () => { const user = userEvent.setup(); const onChange = vi.fn(); - const { container } = render( + render( ); // Click the label text (part of the card, not the input itself) diff --git a/src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx b/src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx index 8261106..62ab9d5 100644 --- a/src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx +++ b/src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx @@ -218,9 +218,6 @@ describe("Property 3: Column configuration application", () => { // Hidden column labels should NOT appear in any header columns.hidden.forEach((col) => { - const matchingHeaders = headers.filter((h) => - h.textContent?.includes(col.label) - ); // Only fail if the hidden label uniquely doesn't appear // (it could coincidentally match a visible label, so we check headers only) const headerTexts = headers.map((h) => h.textContent); diff --git a/src/components/ReadOnlyGrid/ReadOnlyGrid.tsx b/src/components/ReadOnlyGrid/ReadOnlyGrid.tsx index 91b168d..b4847c3 100644 --- a/src/components/ReadOnlyGrid/ReadOnlyGrid.tsx +++ b/src/components/ReadOnlyGrid/ReadOnlyGrid.tsx @@ -195,7 +195,7 @@ export const ReadOnlyGrid: React.FC = ({ const pageSize = pageSizeProp > 0 ? pageSizeProp : 10; // Normalize data — treat undefined/null/non-array as empty - const rows = Array.isArray(data) ? data : []; + const rows = React.useMemo(() => Array.isArray(data) ? data : [], [data]); // Paging state (1-based) const [currentPage, setCurrentPage] = React.useState(1); @@ -281,7 +281,6 @@ export const ReadOnlyGrid: React.FC = ({ const needsScrollContainer = height !== "AUTO" && heightClass !== ""; // Compute paging state (use sortedRows for total count) - const totalPages = Math.ceil(sortedRows.length / pageSize); const startIndex = (currentPage - 1) * pageSize; const endIndex = Math.min(startIndex + pageSize, sortedRows.length);